@@ -33,6 +33,7 @@ import (
3333 "k8s.io/client-go/util/workqueue"
3434 "sigs.k8s.io/controller-runtime/pkg/controller"
3535 "sigs.k8s.io/controller-runtime/pkg/handler"
36+ "sigs.k8s.io/controller-runtime/pkg/leaderelection"
3637 "sigs.k8s.io/controller-runtime/pkg/manager"
3738 "sigs.k8s.io/controller-runtime/pkg/reconcile"
3839 "sigs.k8s.io/controller-runtime/pkg/scheme"
@@ -64,7 +65,7 @@ var _ = Describe("application", func() {
6465 Owns (& appsv1.ReplicaSet {}).
6566 WithOptions (controller.Options {
6667 LeaderElection : & controller.LeaderElectionOptions {
67- NeedLeaderElection : false ,
68+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
6869 },
6970 }).
7071 Build (noop )
@@ -83,7 +84,7 @@ var _ = Describe("application", func() {
8384 Owns (& appsv1.ReplicaSet {}).
8485 WithOptions (controller.Options {
8586 LeaderElection : & controller.LeaderElectionOptions {
86- NeedLeaderElection : false ,
87+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
8788 },
8889 }).
8990 Build (noop )
@@ -110,7 +111,7 @@ var _ = Describe("application", func() {
110111 Owns (& appsv1.ReplicaSet {}).
111112 WithOptions (controller.Options {
112113 LeaderElection : & controller.LeaderElectionOptions {
113- NeedLeaderElection : false ,
114+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
114115 },
115116 }).
116117 Build (noop )
@@ -139,7 +140,7 @@ var _ = Describe("application", func() {
139140 WithOptions (controller.Options {
140141 MaxConcurrentReconciles : maxConcurrentReconciles ,
141142 LeaderElection : & controller.LeaderElectionOptions {
142- NeedLeaderElection : false ,
143+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
143144 },
144145 }).
145146 Build (noop )
@@ -186,7 +187,7 @@ var _ = Describe("application", func() {
186187 Owns (& appsv1.ReplicaSet {}).
187188 WithOptions (controller.Options {
188189 LeaderElection : & controller.LeaderElectionOptions {
189- NeedLeaderElection : false ,
190+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
190191 },
191192 }).
192193 Build (noop )
@@ -199,7 +200,7 @@ var _ = Describe("application", func() {
199200 Owns (& appsv1.ReplicaSet {}).
200201 WithOptions (controller.Options {
201202 LeaderElection : & controller.LeaderElectionOptions {
202- NeedLeaderElection : false ,
203+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
203204 },
204205 }).
205206 Build (noop )
@@ -218,7 +219,7 @@ var _ = Describe("application", func() {
218219 Owns (& appsv1.ReplicaSet {}).
219220 WithOptions (controller.Options {
220221 LeaderElection : & controller.LeaderElectionOptions {
221- NeedLeaderElection : false ,
222+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
222223 },
223224 })
224225 doReconcileTest ("3" , stop , bldr , m , false )
@@ -233,7 +234,7 @@ var _ = Describe("application", func() {
233234 For (& appsv1.Deployment {}).
234235 WithOptions (controller.Options {
235236 LeaderElection : & controller.LeaderElectionOptions {
236- NeedLeaderElection : false ,
237+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
237238 },
238239 }).
239240 Watches ( // Equivalent of Owns
0 commit comments