mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
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
This commit is contained in:
parent
e24a04895a
commit
3b91c26043
1 changed files with 20 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue