| @@ -341,6 +341,9 @@ public class K8sClientUtil { | |||||
| } | } | ||||
| } | } | ||||
| int lastIndex = hostPath.lastIndexOf('/'); | |||||
| String newPath = hostPath.substring(0, lastIndex); | |||||
| V1Pod pod = new V1PodBuilder() | V1Pod pod = new V1PodBuilder() | ||||
| .withNewMetadata() | .withNewMetadata() | ||||
| .withName(podName) | .withName(podName) | ||||
| @@ -368,7 +371,7 @@ public class K8sClientUtil { | |||||
| .endContainer() | .endContainer() | ||||
| .addNewVolume() | .addNewVolume() | ||||
| .withName("workspace") | .withName("workspace") | ||||
| .withHostPath(new V1HostPathVolumeSource().path(hostPath).type("DirectoryOrCreate")) | |||||
| .withHostPath(new V1HostPathVolumeSource().path(newPath).type("DirectoryOrCreate")) | |||||
| // .withPersistentVolumeClaim(new V1PersistentVolumeClaimVolumeSource().claimName(pvcName)) | // .withPersistentVolumeClaim(new V1PersistentVolumeClaimVolumeSource().claimName(pvcName)) | ||||
| .endVolume() | .endVolume() | ||||
| .withTerminationGracePeriodSeconds(14400L) | .withTerminationGracePeriodSeconds(14400L) | ||||