Move 'machineName' and 'plugin' attributes definition to Command class
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>6.19.x
parent
5907d1cad5
commit
99017c4553
|
|
@ -27,6 +27,19 @@ public interface Command {
|
|||
*/
|
||||
String WORKING_DIRECTORY_ATTRIBUTE = "workingDir";
|
||||
|
||||
/**
|
||||
* {@link Command} attribute which indicates in which machine command must be run. It is optional,
|
||||
* IDE should asks user to choose machine if null.
|
||||
*/
|
||||
String MACHINE_NAME_ATTRIBUTE = "machineName";
|
||||
|
||||
/**
|
||||
* {@link Command} attribute which indicates in which plugin command must be run. If specified
|
||||
* plugin has multiple containers then first containers should be used. Attribute value has the
|
||||
* following format: `{PLUGIN_ID}:{PLUGIN_VERSION}`. For example: org.eclipse.sample-plugin:0.0.1
|
||||
*/
|
||||
String PLUGIN_ATTRIBUTE = "plugin";
|
||||
|
||||
/**
|
||||
* Returns command name (i.e. 'start tomcat') The name should be unique per user in one workspace,
|
||||
* which means that user may create only one command with the same name in the same workspace
|
||||
|
|
|
|||
|
|
@ -216,7 +216,12 @@ public class KubernetesPluginsToolingApplier implements ChePluginsApplier {
|
|||
machineConfig.getAttributes().put(CONTAINER_SOURCE_ATTRIBUTE, TOOL_CONTAINER_SOURCE);
|
||||
kubernetesEnvironment.getMachines().put(machineName, machineConfig);
|
||||
|
||||
sidecarRelatedCommands.forEach(c -> c.getAttributes().put("machineName", machineName));
|
||||
sidecarRelatedCommands.forEach(
|
||||
c ->
|
||||
c.getAttributes()
|
||||
.put(
|
||||
org.eclipse.che.api.core.model.workspace.config.Command.MACHINE_NAME_ATTRIBUTE,
|
||||
machineName));
|
||||
|
||||
container
|
||||
.getCommands()
|
||||
|
|
@ -241,6 +246,7 @@ public class KubernetesPluginsToolingApplier implements ChePluginsApplier {
|
|||
}
|
||||
|
||||
private static class CommandsResolver {
|
||||
|
||||
private final KubernetesEnvironment k8sEnvironment;
|
||||
private final ArrayListMultimap<String, CommandImpl> pluginRefToCommand;
|
||||
|
||||
|
|
@ -252,7 +258,11 @@ public class KubernetesPluginsToolingApplier implements ChePluginsApplier {
|
|||
.getCommands()
|
||||
.forEach(
|
||||
(c) -> {
|
||||
String pluginRef = c.getAttributes().get("plugin");
|
||||
String pluginRef =
|
||||
c.getAttributes()
|
||||
.get(
|
||||
org.eclipse.che.api.core.model.workspace.config.Command
|
||||
.PLUGIN_ATTRIBUTE);
|
||||
if (pluginRef != null) {
|
||||
pluginRefToCommand.put(pluginRef, c);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue