Skip to content

Commit c9348b5

Browse files
authored
update docs to reflect call to NewManager (#3651)
Signed-off-by: Jose R. Gonzalez <[email protected]>
1 parent f04ad07 commit c9348b5

File tree

1 file changed

+3
-3
lines changed
  • website/content/en/docs/building-operators/golang

1 file changed

+3
-3
lines changed

website/content/en/docs/building-operators/golang/tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ See the [Kubebuilder entrypoint doc][kubebuilder_entrypoint_doc] for more detail
3939

4040
The Manager can restrict the namespace that all controllers will watch for resources:
4141
```Go
42-
mgr, err := manager.New(cfg, manager.Options{Namespace: namespace})
42+
mgr, err := ctrl.NewManager(cfg, manager.Options{Namespace: namespace})
4343
```
4444
By default this will be the namespace that the operator is running in. To watch all namespaces leave the namespace option empty:
4545
```Go
46-
mgr, err := manager.New(cfg, manager.Options{Namespace: ""})
46+
mgr, err := ctrl.NewManager(cfg, manager.Options{Namespace: ""})
4747
```
4848

4949
It is also possible to use the [MultiNamespacedCacheBuilder][multi-namespaced-cache-builder] to watch a specific set of namespaces:
5050
```Go
5151
var namespaces []string // List of Namespaces
5252
// Create a new Cmd to provide shared dependencies and start components
53-
mgr, err := manager.New(cfg, manager.Options{
53+
mgr, err := ctrl.NewManager(cfg, manager.Options{
5454
NewCache: cache.MultiNamespacedCacheBuilder(namespaces),
5555
})
5656
```

0 commit comments

Comments
 (0)