diff --git a/website/content/en/docs/building-operators/golang/operator-scope.md b/website/content/en/docs/building-operators/golang/operator-scope.md index 05b405080c..2615012004 100644 --- a/website/content/en/docs/building-operators/golang/operator-scope.md +++ b/website/content/en/docs/building-operators/golang/operator-scope.md @@ -194,7 +194,9 @@ mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Port: 9443, LeaderElection: enableLeaderElection, LeaderElectionID: "f1c5ece8.example.com", - Namespace: watchNamespace, // namespaced-scope when the value is not an empty string + Cache: cache.Options{ + DefaultNamespaces: map[string]cache.Config{watchNamespace: cache.Config{}}, + }, }) ... ``` @@ -246,7 +248,9 @@ options := ctrl.Options{ Port: 9443, LeaderElection: enableLeaderElection, LeaderElectionID: "f1c5ece8.example.com", - Namespace: watchNamespace, // namespaced-scope when the value is not an empty string + Cache: cache.Options{ + DefaultNamespaces: map[string]cache.Config{watchNamespace: cache.Config{}}, + }, } // Add support for MultiNamespace set in WATCH_NAMESPACE (e.g ns1,ns2)