Search in sources :

Example 1 with VolumeMount

use of io.fabric8.kubernetes.api.model.VolumeMount in project che by eclipse.

the class OpenShiftConnector method getVolumeMountsFrom.

private List<VolumeMount> getVolumeMountsFrom(String[] volumes, String workspaceID) {
    List<VolumeMount> vms = new ArrayList<>();
    for (String volume : volumes) {
        String mountPath = volume.split(":", 3)[1];
        String volumeName = getVolumeName(volume);
        VolumeMount vm = new VolumeMountBuilder().withMountPath(mountPath).withName("ws-" + workspaceID + "-" + volumeName).build();
        vms.add(vm);
    }
    return vms;
}
Also used : ArrayList(java.util.ArrayList) VolumeMount(io.fabric8.kubernetes.api.model.VolumeMount) VolumeMountBuilder(io.fabric8.kubernetes.api.model.VolumeMountBuilder)

Aggregations

VolumeMount (io.fabric8.kubernetes.api.model.VolumeMount)1 VolumeMountBuilder (io.fabric8.kubernetes.api.model.VolumeMountBuilder)1 ArrayList (java.util.ArrayList)1