Skip to content

Commit

Permalink
fix(e2): don't check lease if leader election is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tallaxes committed Jan 14, 2025
1 parent 9487357 commit 93d641c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/pkg/environment/common/expectations.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,12 @@ func (env *Environment) EventuallyExpectKarpenterRestarted() {
GinkgoHelper()
By("rolling out the new karpenter deployment")
env.EventuallyExpectRollout("karpenter", "kube-system")
env.ExpectKarpenterLeaseOwnerChanged()

if !lo.ContainsBy(env.ExpectSettings(), func(v corev1.EnvVar) bool {
return v.Name == "DISABLE_LEADER_ELECTION" && v.Value == "true"
}) {
env.ExpectKarpenterLeaseOwnerChanged()
}
}

func (env *Environment) ExpectKarpenterLeaseOwnerChanged() {
Expand Down

0 comments on commit 93d641c

Please sign in to comment.