From dde44bf9735a21ebc332001eb2480c13de204741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=A4hler?= Date: Mon, 27 May 2024 10:23:28 +0200 Subject: [PATCH] chore: preview --- controllers/tenant/manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/tenant/manager.go b/controllers/tenant/manager.go index f797bfa54..4cfba841e 100644 --- a/controllers/tenant/manager.go +++ b/controllers/tenant/manager.go @@ -16,6 +16,7 @@ import ( "k8s.io/client-go/util/retry" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" capsulev1beta2 "github.com/projectcapsule/capsule/api/v1beta2" @@ -31,11 +32,11 @@ type Manager struct { func (r *Manager) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&capsulev1beta2.Tenant{}). - Owns(&corev1.Namespace{}). Owns(&networkingv1.NetworkPolicy{}). Owns(&corev1.LimitRange{}). Owns(&corev1.ResourceQuota{}). Owns(&rbacv1.RoleBinding{}). + Watches(&corev1.Namespace{}, handler.EnqueueRequestForOwner(mgr.GetScheme(), mgr.GetRESTMapper(), &capsulev1beta2.Tenant{})). Complete(r) }