From 4b1d1294e28821490eed4be5160d7437f788aeb3 Mon Sep 17 00:00:00 2001 From: Kazuhito MATSUDA Date: Thu, 26 Sep 2019 18:37:31 +0900 Subject: [PATCH] modify test code. --- controllers/cronjob_controller_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/controllers/cronjob_controller_test.go b/controllers/cronjob_controller_test.go index 314c326..67d86c0 100644 --- a/controllers/cronjob_controller_test.go +++ b/controllers/cronjob_controller_test.go @@ -30,7 +30,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" batchv1 "github.com/kfyharukz/kubebuilder-tutorial/api/v1" - kbatch "k8s.io/api/batch/v1" ) func testCronjobReconcile() { @@ -51,10 +50,7 @@ func testCronjobReconcile() { Scheme: mgr.GetScheme(), } - err = ctrl.NewControllerManagedBy(mgr). - For(&batchv1.CronJob{}). - Owns(&kbatch.Job{}). - Complete(rc) + err = rc.SetupWithManager(mgr) Expect(err).NotTo(HaveOccurred()) stopMgr, mgrStopped = StartTestManager(mgr)