Search in sources :

Example 1 with VolumeBuilder

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

the class OpenShiftConnector method getVolumesFrom.

private List<Volume> getVolumesFrom(String[] volumes, String workspaceID) {
    List<Volume> vs = new ArrayList<>();
    for (String volume : volumes) {
        String hostPath = volume.split(":", 3)[0];
        String volumeName = getVolumeName(volume);
        Volume v = new VolumeBuilder().withNewHostPath(hostPath).withName("ws-" + workspaceID + "-" + volumeName).build();
        vs.add(v);
    }
    return vs;
}
Also used : Volume(io.fabric8.kubernetes.api.model.Volume) ArrayList(java.util.ArrayList) VolumeBuilder(io.fabric8.kubernetes.api.model.VolumeBuilder)

Aggregations

Volume (io.fabric8.kubernetes.api.model.Volume)1 VolumeBuilder (io.fabric8.kubernetes.api.model.VolumeBuilder)1 ArrayList (java.util.ArrayList)1