Skip to content
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 @@ -45,6 +45,8 @@
import eu.openanalytics.containerproxy.model.runtime.Proxy;
import eu.openanalytics.containerproxy.model.spec.ContainerSpec;
import eu.openanalytics.containerproxy.util.Retrying;
import io.fabric8.kubernetes.api.model.ConfigMapVolumeSource;
import io.fabric8.kubernetes.api.model.ConfigMapVolumeSourceBuilder;
import io.fabric8.kubernetes.api.model.ContainerBuilder;
import io.fabric8.kubernetes.api.model.ContainerPort;
import io.fabric8.kubernetes.api.model.ContainerPortBuilder;
Expand Down Expand Up @@ -122,13 +124,28 @@ protected Container startContainer(ContainerSpec spec, Proxy proxy) throws Excep
VolumeMount[] volumeMounts = new VolumeMount[volumeStrings.length];
for (int i = 0; i < volumeStrings.length; i++) {
String[] volume = volumeStrings[i].split(":");
String hostSource = volume[0];
String volumeName = volume[0];
String containerDest = volume[1];
String name = "shinyproxy-volume-" + i;
volumes.add(new VolumeBuilder()
.withNewHostPath(hostSource)
if (volumeName.startsWith("configmap_")) {
ConfigMapVolumeSource configMapVolumeSource = new ConfigMapVolumeSourceBuilder()
.withName(volumeName.replace("configmap_",""))
.build();
volumes.add(new VolumeBuilder()
.withConfigMap(configMapVolumeSource)
.withName(name)
.build());
} else if (volumeName.startsWith("claim_")) {
volumes.add(new VolumeBuilder()
.withNewPersistentVolumeClaim(volumeName.replace("claim_",""),true)
.withName(name)
.build());
} else {
volumes.add(new VolumeBuilder()
.withNewHostPath(volumeName)
.withName(name)
.build());
}
volumeMounts[i] = new VolumeMountBuilder()
.withMountPath(containerDest)
.withName(name)
Expand Down Expand Up @@ -296,4 +313,4 @@ protected String getPropertyPrefix() {
return PROPERTY_PREFIX;
}

}
}