Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2018-01-24 17:54:18 +0000
committerJeff Johnston2018-01-24 21:26:07 +0000
commit5801b60b191e6a0df24f9176534d2fc47182318c (patch)
tree8520bb0170c41c16eca484d11c6c2136ba2a6bbb
parent96664e0f17e1a5de39ef07ed689481f17ecf2038 (diff)
downloadorg.eclipse.cdt-5801b60b191e6a0df24f9176534d2fc47182318c.tar.gz
org.eclipse.cdt-5801b60b191e6a0df24f9176534d2fc47182318c.tar.xz
org.eclipse.cdt-5801b60b191e6a0df24f9176534d2fc47182318c.zip
Fix launch config matching for Run as Container Application
- fix LaunchShortcut find launch config method so that if the active configuration is not enabled for Container build, then it will look for config with default connection and image Change-Id: If11865dd43cd2a08a0565b3483523002b0a00613 (cherry picked from commit 3b91c26043b2b53bf2117dfab5ef61d7b3abfaee)
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
index 64cd3a289d..255a37258a 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
@@ -281,6 +281,22 @@ public class LaunchShortcut implements ILaunchShortcut {
imageName = props
.getProperty(ContainerCommandLauncher.IMAGE_ID);
}
+ } else {
+ IDockerConnection[] connections = DockerConnectionManager
+ .getInstance().getConnections();
+ if (connections != null && connections.length > 0) {
+ connectionUri = connections[0].getUri();
+ Preferences prefs = InstanceScope.INSTANCE
+ .getNode(DockerLaunchUIPlugin.PLUGIN_ID);
+ imageName = prefs.get(PreferenceConstants.DEFAULT_IMAGE,
+ null);
+ if (imageName == null) {
+ List<IDockerImage> images = connections[0]
+ .getImages();
+ if (images != null && images.size() > 0)
+ imageName = images.get(0).repoTags().get(0);
+ }
+ }
}
}
}
@@ -302,9 +318,10 @@ public class LaunchShortcut implements ILaunchShortcut {
if (connectionUri != null
&& connectionUri.equals(config.getAttribute(
ILaunchConstants.ATTR_CONNECTION_URI,
- connectionUri))) {
- if (imageName.equals(config.getAttribute(
- ILaunchConstants.ATTR_IMAGE, imageName))) {
+ (String) null))) {
+ if (imageName != null && imageName.equals(config
+ .getAttribute(ILaunchConstants.ATTR_IMAGE,
+ (String) null))) {
candidateConfigs.add(config);
}
}

Back to the top