diff options
author | Jeff Johnston | 2019-08-22 20:50:59 +0000 |
---|---|---|
committer | Jeff Johnston | 2019-08-23 02:11:32 +0000 |
commit | f874f011ddbb3c841aa5881470599ef5ee23846b (patch) | |
tree | 935bfa0f3b93ad3345f0c9b10c5edef8933c6c0b /containers | |
parent | ca989ebd9c0049dd327462149fc264cb6c66e2f5 (diff) | |
download | org.eclipse.linuxtools-f874f011ddbb3c841aa5881470599ef5ee23846b.tar.gz org.eclipse.linuxtools-f874f011ddbb3c841aa5881470599ef5ee23846b.tar.xz org.eclipse.linuxtools-f874f011ddbb3c841aa5881470599ef5ee23846b.zip |
Bug 550348 - Java container support shows image id rather than repo tag
- fix ContainerLauncher.launch() method to check if the image name to be
shown matches the image id and if so, get the DockerImage to figure
out the first repo tag and use it instead
Change-Id: Ifc35e9efffc6aaab64bd3c077212550a604d9017
Reviewed-on: https://git.eclipse.org/r/148164
Tested-by: Linux Tools Bot <linuxtools-bot@eclipse.org>
Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
Diffstat (limited to 'containers')
-rw-r--r-- | containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java index 66275d9b47..8d13f965b0 100644 --- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java +++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java @@ -956,11 +956,12 @@ public class ContainerLauncher { IDockerImageInfo imageInfo = connection.getImageInfo(image); if (imageInfo == null) { + final String name = image; Display.getDefault() .syncExec(() -> MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DVMessages.getString(ERROR_LAUNCHING_CONTAINER), - Messages.getFormattedString("ContainerLaunch.imageNotFound.error", image))); + Messages.getFormattedString("ContainerLaunch.imageNotFound.error", name))); return; } @@ -1025,6 +1026,11 @@ public class ContainerLauncher { final IDockerHostConfig hostConfig = hostBuilder.build(); + if (image.equals(imageInfo.id())) { + IDockerImage dockerImage = ((DockerConnection) connection).getImage(image); + image = dockerImage.repoTags().get(0); + } + final String imageName = image; final boolean keepContainer = keep; final String consoleId = id; |