Skip to content

Commit 6644ff3

Browse files
committed
Merge remote-tracking branch 'origin/main' into release/4.0
2 parents b29cc85 + 8a70c67 commit 6644ff3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

common/src/main/java/oracle/kubernetes/common/utils/SchemaConversionUtils.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -658,11 +658,12 @@ private Map<String,Object> createEmptyDirVolume(Map<String, Object> auxiliaryIma
658658

659659
private void addVolumeMountIfMissing(Map<String, Object> serverPod, Map<String, Object> auxiliaryImage,
660660
String mountPath) {
661-
if (Optional.ofNullable(serverPod.get(VOLUME_MOUNTS)).map(volumeMounts -> ((List)volumeMounts).stream().noneMatch(
662-
volumeMount -> hasMatchingVolumeMountName(volumeMount, auxiliaryImage))).orElse(true)) {
663-
List<Object> volumeMounts = new ArrayList<>();
664-
volumeMounts.add(getVolumeMount(auxiliaryImage, mountPath));
665-
serverPod.put(VOLUME_MOUNTS, volumeMounts);
661+
List<Object> existingVolumeMounts = Optional.ofNullable((List<Object>) serverPod.get(VOLUME_MOUNTS))
662+
.orElse(new ArrayList<>());
663+
if (existingVolumeMounts.stream()
664+
.noneMatch(volumeMount -> hasMatchingVolumeMountName(volumeMount, auxiliaryImage))) {
665+
existingVolumeMounts.add(getVolumeMount(auxiliaryImage, mountPath));
666+
serverPod.put(VOLUME_MOUNTS, existingVolumeMounts);
666667
}
667668
}
668669

0 commit comments

Comments
 (0)