File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1165,6 +1165,22 @@ var _ = Describe("manger.Manager", func() {
1165
1165
cm .onStoppedLeading = func () {}
1166
1166
},
1167
1167
)
1168
+
1169
+ It ("should return an error if leader election param incorrect" , func () {
1170
+ renewDeadline := time .Second * 20
1171
+ m , err := New (cfg , Options {
1172
+ LeaderElection : true ,
1173
+ LeaderElectionID : "controller-runtime" ,
1174
+ LeaderElectionNamespace : "default" ,
1175
+ newResourceLock : fakeleaderelection .NewResourceLock ,
1176
+ RenewDeadline : & renewDeadline ,
1177
+ })
1178
+ Expect (err ).NotTo (HaveOccurred ())
1179
+ ctx , cancel := context .WithTimeout (context .Background (), time .Second * 10 )
1180
+ defer cancel ()
1181
+ Expect (m .Start (ctx )).To (HaveOccurred ())
1182
+ Expect (errors .Is (err , context .DeadlineExceeded )).NotTo (BeTrue ())
1183
+ })
1168
1184
})
1169
1185
1170
1186
Context ("should start serving metrics" , func () {
You can’t perform that action at this time.
0 commit comments