diff --git a/test/pkg/environment/common/expectations.go b/test/pkg/environment/common/expectations.go index af3876eee..75274e0e8 100644 --- a/test/pkg/environment/common/expectations.go +++ b/test/pkg/environment/common/expectations.go @@ -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() {