Limit kubebuilder controllers to work only for objects in own namespaces

Signed-off-by: F. Gold <fgold@vmware.com>
pull/4251/head
F. Gold 2021-10-18 17:09:28 -07:00
parent e1e6332e07
commit 9f06a1b451
No known key found for this signature in database
GPG Key ID: DB33E71F09A5BF25
1 changed files with 2 additions and 1 deletions

View File

@ -303,7 +303,8 @@ func newServer(f client.Factory, config serverConfig, logger *logrus.Logger) (*s
corev1api.AddToScheme(scheme)
mgr, err := ctrl.NewManager(clientConfig, ctrl.Options{
Scheme: scheme,
Scheme: scheme,
Namespace: f.Namespace(),
})
if err != nil {
cancelFunc()