Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the sidecar-plugins volume to enable remote plugin isolation #13342

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.eclipse.che.api.core.model.workspace.config.Volume;
import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
import org.eclipse.che.api.workspace.server.model.impl.VolumeImpl;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
Expand Down Expand Up @@ -69,6 +70,7 @@ public abstract class BrokerEnvironmentFactory<E extends KubernetesEnvironment>
private static final String BROKER_VOLUME = "broker-config-volume";
private static final String CONF_FOLDER = "/broker-config";
private static final String PLUGINS_VOLUME_NAME = "plugins";
private static final String SIDECAR_PLUGINS_VOLUME_NAME = "sidecar-plugins";
private static final String BROKERS_POD_NAME = "che-plugin-broker";

private final ObjectMapper objectMapper = new ObjectMapper();
Expand Down Expand Up @@ -229,10 +231,9 @@ private BrokerConfig createBrokerConfig(
brokerConfig.container = newContainer(runtimeId, envVars, image, configMapVolume);
brokerConfig.machineName = Names.machineName(pod, brokerConfig.container);
brokerConfig.machineConfig = new InternalMachineConfig();
brokerConfig
.machineConfig
.getVolumes()
.put(PLUGINS_VOLUME_NAME, new VolumeImpl().withPath("/plugins"));
Map<String, Volume> volumes = brokerConfig.machineConfig.getVolumes();
volumes.put(SIDECAR_PLUGINS_VOLUME_NAME, new VolumeImpl().withPath("/sidecar-plugins"));
volumes.put(PLUGINS_VOLUME_NAME, new VolumeImpl().withPath("/plugins"));

return brokerConfig;
}
Expand Down