use of org.eclipse.linuxtools.docker.core.IDockerImageSearchResult in project jbosstools-openshift by jbosstools.
the class DeployImageWizard method getPushImageToRegistryJob.
private static PushImageToRegistryJob getPushImageToRegistryJob(final IDeployImageParameters model) {
final IDockerConnection dockerConnection = model.getDockerConnection();
final String imageName = model.getImageName();
final String deployProjectName = model.getProject().getName();
final IRegistryAccount registryAccount = new IRegistryAccount() {
@Override
public String getServerAddress() {
return model.getTargetRegistryLocation();
}
@Override
public String getUsername() {
return model.getTargetRegistryUsername();
}
@Override
public char[] getPassword() {
return model.getTargetRegistryPassword().toCharArray();
}
@Override
public String getEmail() {
return null;
}
@Override
public List<IRepositoryTag> getTags(String arg0) throws DockerException {
return null;
}
@Override
public boolean isVersion2() {
return false;
}
@Override
public List<IDockerImageSearchResult> getImages(String arg0) throws DockerException {
return null;
}
};
return new PushImageToRegistryJob(dockerConnection, registryAccount, deployProjectName, imageName);
}
use of org.eclipse.linuxtools.docker.core.IDockerImageSearchResult in project linuxtools by eclipse.
the class DockerConnection method searchImages.
@Override
public List<IDockerImageSearchResult> searchImages(final String term) throws DockerException {
try {
final List<ImageSearchResult> searchResults = client.searchImages(term);
final List<IDockerImageSearchResult> results = new ArrayList<>();
for (ImageSearchResult r : searchResults) {
if (r.name().contains(term)) {
results.add(new DockerImageSearchResult(r.description(), r.official(), r.automated(), r.name(), r.starCount()));
}
}
return results;
} catch (com.spotify.docker.client.exceptions.DockerException | InterruptedException e) {
throw new DockerException(e);
}
}
Aggregations