@@ -32,6 +32,7 @@ import (
3232 "k8s.io/apimachinery/pkg/types"
3333 "sigs.k8s.io/controller-runtime/pkg/controller"
3434 "sigs.k8s.io/controller-runtime/pkg/handler"
35+ "sigs.k8s.io/controller-runtime/pkg/leaderelection"
3536 "sigs.k8s.io/controller-runtime/pkg/manager"
3637 "sigs.k8s.io/controller-runtime/pkg/reconcile"
3738 "sigs.k8s.io/controller-runtime/pkg/scheme"
@@ -63,7 +64,7 @@ var _ = Describe("application", func() {
6364 Owns (& appsv1.ReplicaSet {}).
6465 WithOptions (controller.Options {
6566 LeaderElection : & controller.LeaderElectionOptions {
66- NeedLeaderElection : false ,
67+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
6768 },
6869 }).
6970 Build (noop )
@@ -82,7 +83,7 @@ var _ = Describe("application", func() {
8283 Owns (& appsv1.ReplicaSet {}).
8384 WithOptions (controller.Options {
8485 LeaderElection : & controller.LeaderElectionOptions {
85- NeedLeaderElection : false ,
86+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
8687 },
8788 }).
8889 Build (noop )
@@ -109,7 +110,7 @@ var _ = Describe("application", func() {
109110 Owns (& appsv1.ReplicaSet {}).
110111 WithOptions (controller.Options {
111112 LeaderElection : & controller.LeaderElectionOptions {
112- NeedLeaderElection : false ,
113+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
113114 },
114115 }).
115116 Build (noop )
@@ -138,7 +139,7 @@ var _ = Describe("application", func() {
138139 WithOptions (controller.Options {
139140 MaxConcurrentReconciles : maxConcurrentReconciles ,
140141 LeaderElection : & controller.LeaderElectionOptions {
141- NeedLeaderElection : false ,
142+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
142143 },
143144 }).
144145 Build (noop )
@@ -163,7 +164,7 @@ var _ = Describe("application", func() {
163164 Owns (& appsv1.ReplicaSet {}).
164165 WithOptions (controller.Options {
165166 LeaderElection : & controller.LeaderElectionOptions {
166- NeedLeaderElection : false ,
167+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
167168 },
168169 }).
169170 Build (noop )
@@ -176,7 +177,7 @@ var _ = Describe("application", func() {
176177 Owns (& appsv1.ReplicaSet {}).
177178 WithOptions (controller.Options {
178179 LeaderElection : & controller.LeaderElectionOptions {
179- NeedLeaderElection : false ,
180+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
180181 },
181182 }).
182183 Build (noop )
@@ -195,7 +196,7 @@ var _ = Describe("application", func() {
195196 Owns (& appsv1.ReplicaSet {}).
196197 WithOptions (controller.Options {
197198 LeaderElection : & controller.LeaderElectionOptions {
198- NeedLeaderElection : false ,
199+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
199200 },
200201 })
201202 doReconcileTest ("3" , stop , bldr , m , false )
@@ -210,7 +211,7 @@ var _ = Describe("application", func() {
210211 For (& appsv1.Deployment {}).
211212 WithOptions (controller.Options {
212213 LeaderElection : & controller.LeaderElectionOptions {
213- NeedLeaderElection : false ,
214+ LeaderElectionMode : leaderelection . NonLeaderElectionMode ,
214215 },
215216 }).
216217 Watches ( // Equivalent of Owns
0 commit comments