|
1 | | -// Copyright (c) 2017, 2024, Oracle and/or its affiliates. |
| 1 | +// Copyright (c) 2017, 2025, Oracle and/or its affiliates. |
2 | 2 | // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. |
3 | 3 |
|
4 | 4 | package oracle.kubernetes.weblogic.domain.model; |
@@ -83,15 +83,21 @@ private void checkOverlappingMountPaths(DomainSpec spec, V1VolumeMount mount1, V |
83 | 83 | return; |
84 | 84 | } |
85 | 85 |
|
86 | | - List<String> list1 = getTokensWithCollection(mount1.getMountPath()); |
87 | | - List<String> list2 = getTokensWithCollection(mount2.getMountPath()); |
88 | | - for (int i = 0; i < Math.min(list1.size(), list2.size()); i++) { |
89 | | - if (!list1.get(i).equals(list2.get(i))) { |
90 | | - return; |
| 86 | + if (spec.getDomainHome() != null) { |
| 87 | + List<String> domainHomeTokens = getTokensWithCollection(spec.getDomainHome()); |
| 88 | + List<String> list1 = getTokensWithCollection(mount1.getMountPath()); |
| 89 | + List<String> list2 = getTokensWithCollection(mount2.getMountPath()); |
| 90 | + for (int i = 0; i < Math.min(list1.size(), list2.size()); i++) { |
| 91 | + if (!list1.get(i).equals(list2.get(i))) { |
| 92 | + return; |
| 93 | + } |
| 94 | + } |
| 95 | + if (list1.getFirst().equals(domainHomeTokens.getFirst()) |
| 96 | + && list2.getFirst().equals(domainHomeTokens.getFirst())) { |
| 97 | + failures.add(DomainValidationMessages.overlappingVolumeMountPath(mount1, mount2)); |
91 | 98 | } |
92 | 99 | } |
93 | 100 |
|
94 | | - failures.add(DomainValidationMessages.overlappingVolumeMountPath(mount1, mount2)); |
95 | 101 | } |
96 | 102 |
|
97 | 103 | private List<String> getTokensWithCollection(String str) { |
|
0 commit comments