diff --git a/CHANGELOG.md b/CHANGELOG.md index 86cb4ed81..08ff966cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ ### Fixed Bugs +- [PR #109](https://github.com/Orange-OpenSource/nifikop/pull/109) - **[Operator/NifiCluster]** Change namespace watch configuration to manage single namespace deletion. + + ## v0.6.1 ### Added diff --git a/main.go b/main.go index d93827d67..a85257ee4 100644 --- a/main.go +++ b/main.go @@ -92,16 +92,18 @@ func main() { HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, LeaderElectionID: "f1c5ece8.example.com", - Namespace: watchNamespace, // namespaced-scope when the value is not an empty string } // Add support for MultiNamespace set in WATCH_NAMESPACE (e.g ns1,ns2) var namespaceList []string - if strings.Contains(watchNamespace, ",") { + if watchNamespace != "" { setupLog.Info("manager set up with multiple namespaces", "namespaces", watchNamespace) namespaceList = strings.Split(watchNamespace, ",") + + for i := range namespaceList { + namespaceList[i] = strings.TrimSpace(namespaceList[i]) + } // configure cluster-scoped with MultiNamespacedCacheBuilder - options.Namespace = "" options.NewCache = cache.MultiNamespacedCacheBuilder(namespaceList) }