From 1f5fcb6720b29431f924ddf248f7520d9eed2015 Mon Sep 17 00:00:00 2001 From: kkkkun Date: Tue, 6 Jun 2023 16:13:25 +0800 Subject: [PATCH] fix ut --- .../internal/controller/admiral_controller.go | 4 ++-- .../internal/controller/captain_controller.go | 4 ++-- .../internal/controller/firstmate_controller.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go b/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go index b9a7f0fb350..126171a2a18 100644 --- a/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go +++ b/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go @@ -74,13 +74,13 @@ func (r *AdmiralReconciler) SetupWithManager(mgr ctrl.Manager) error { } // Watch for changes to Admiral - err = c.Watch(&source.Kind{Type: &crewv1.Admiral{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(source.Kind(mgr.GetCache(), &crewv1.Admiral{}), &handler.EnqueueRequestForObject{}) if err != nil { return err } // Watch for changes to deployed objects - _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels) + err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels) if err != nil { return err } diff --git a/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go b/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go index 81ec7726e1c..5de7552186b 100644 --- a/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go +++ b/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go @@ -74,13 +74,13 @@ func (r *CaptainReconciler) SetupWithManager(mgr ctrl.Manager) error { } // Watch for changes to Captain - err = c.Watch(&source.Kind{Type: &crewv1.Captain{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(source.Kind(mgr.GetCache(), &crewv1.Captain{}), &handler.EnqueueRequestForObject{}) if err != nil { return err } // Watch for changes to deployed objects - _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels) + err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels) if err != nil { return err } diff --git a/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go b/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go index 089c069f6ac..28d592cad9a 100644 --- a/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go +++ b/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go @@ -74,13 +74,13 @@ func (r *FirstMateReconciler) SetupWithManager(mgr ctrl.Manager) error { } // Watch for changes to FirstMate - err = c.Watch(&source.Kind{Type: &crewv1.FirstMate{}}, &handler.EnqueueRequestForObject{}) + err = c.Watch(source.Kind(mgr.GetCache(), &crewv1.FirstMate{}), &handler.EnqueueRequestForObject{}) if err != nil { return err } // Watch for changes to deployed objects - _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels) + err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels) if err != nil { return err }