Skip to content

Commit 312c883

Browse files
committed
fix: do not change namespaces if they were manually set
1 parent 2456188 commit 312c883

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResourceConfig.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,12 @@ public ResourceDiscriminator getResourceDiscriminator() {
9191

9292
@Override
9393
public void changeNamespaces(Set<String> namespaces) {
94-
if (!wereNamespacesConfigured()) {
95-
this.namespacesWereConfigured = true;
96-
setNamespaces(namespaces);
97-
}
94+
setNamespaces(namespaces);
95+
this.namespacesWereConfigured = true;
9896
}
9997

10098
protected void setNamespaces(Set<String> namespaces) {
101-
if (namespaces != null && !namespaces.isEmpty()) {
99+
if (!wereNamespacesConfigured() && namespaces != null && !namespaces.isEmpty()) {
102100
this.namespaces = namespaces;
103101
}
104102
}

0 commit comments

Comments
 (0)