Skip to content

Commit 11ff3c8

Browse files
authored
Update code snippets (#6796) (#6839)
Signed-off-by: kevalsabhani <kevalsabhani@gmail.com>
1 parent 9e633b0 commit 11ff3c8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

website/content/en/docs/building-operators/golang/operator-scope.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
194194
Port: 9443,
195195
LeaderElection: enableLeaderElection,
196196
LeaderElectionID: "f1c5ece8.example.com",
197-
Namespace: watchNamespace, // namespaced-scope when the value is not an empty string
197+
Cache: cache.Options{
198+
DefaultNamespaces: map[string]cache.Config{watchNamespace: cache.Config{}},
199+
},
198200
})
199201
...
200202
```
@@ -246,7 +248,9 @@ options := ctrl.Options{
246248
Port: 9443,
247249
LeaderElection: enableLeaderElection,
248250
LeaderElectionID: "f1c5ece8.example.com",
249-
Namespace: watchNamespace, // namespaced-scope when the value is not an empty string
251+
Cache: cache.Options{
252+
DefaultNamespaces: map[string]cache.Config{watchNamespace: cache.Config{}},
253+
},
250254
}
251255
252256
// Add support for MultiNamespace set in WATCH_NAMESPACE (e.g ns1,ns2)

0 commit comments

Comments
 (0)