@Test public void testValidVolumeNames() { assertThat(VolumeUtils.getValidVolumeName("my-user"), is("my-user")); assertThat(VolumeUtils.getValidVolumeName("my-0123456789012345678901234567890123456789012345678901234-user"), is("my-0123456789012345678901234567890123456789012345678901234-user")); }
public static String getValidVolumeName(String originalName) { if (originalName == null) { throw new RuntimeException("Volume name cannot be null"); } if (volumeNamePattern.matcher(originalName).matches()) { return originalName; } else { return makeValidVolumeName(originalName); } }
VolumeUtils { public static String getValidVolumeName(String originalName) { if (originalName == null) { throw new RuntimeException("Volume name cannot be null"); } if (volumeNamePattern.matcher(originalName).matches()) { return originalName; } else { return makeValidVolumeName(originalName); } } }
VolumeUtils { public static String getValidVolumeName(String originalName) { if (originalName == null) { throw new RuntimeException("Volume name cannot be null"); } if (volumeNamePattern.matcher(originalName).matches()) { return originalName; } else { return makeValidVolumeName(originalName); } }  }
VolumeUtils { public static String getValidVolumeName(String originalName) { if (originalName == null) { throw new RuntimeException("Volume name cannot be null"); } if (volumeNamePattern.matcher(originalName).matches()) { return originalName; } else { return makeValidVolumeName(originalName); } }  static Volume createConfigMapVolume(String name, String configMapName); static Volume createSecretVolume(String name, String secretName, Map<String, String> items, boolean isOpenshift); static Volume createSecretVolume(String name, String secretName, boolean isOpenshift); static Volume createEmptyDirVolume(String name, String sizeLimit); static PersistentVolumeClaim createPersistentVolumeClaimTemplate(String name, PersistentClaimStorage storage); static VolumeMount createVolumeMount(String name, String path); static List<Volume> getDataVolumes(Storage storage); static List<PersistentVolumeClaim> getDataPersistentVolumeClaims(Storage storage); static List<VolumeMount> getDataVolumeMountPaths(Storage storage, String mountPath); static String getVolumePrefix(Integer id); static String getValidVolumeName(String originalName); }
VolumeUtils { public static String getValidVolumeName(String originalName) { if (originalName == null) { throw new RuntimeException("Volume name cannot be null"); } if (volumeNamePattern.matcher(originalName).matches()) { return originalName; } else { return makeValidVolumeName(originalName); } }  static Volume createConfigMapVolume(String name, String configMapName); static Volume createSecretVolume(String name, String secretName, Map<String, String> items, boolean isOpenshift); static Volume createSecretVolume(String name, String secretName, boolean isOpenshift); static Volume createEmptyDirVolume(String name, String sizeLimit); static PersistentVolumeClaim createPersistentVolumeClaimTemplate(String name, PersistentClaimStorage storage); static VolumeMount createVolumeMount(String name, String path); static List<Volume> getDataVolumes(Storage storage); static List<PersistentVolumeClaim> getDataPersistentVolumeClaims(Storage storage); static List<VolumeMount> getDataVolumeMountPaths(Storage storage, String mountPath); static String getVolumePrefix(Integer id); static String getValidVolumeName(String originalName);  }