diff --git a/pkg/webhookconfig/registration.go b/pkg/webhookconfig/registration.go index 2a1ee6e2b5..9f6cb8c3dc 100644 --- a/pkg/webhookconfig/registration.go +++ b/pkg/webhookconfig/registration.go @@ -260,7 +260,7 @@ func (wrc *Register) cleanupKyvernoResource() bool { logger.Info("Kyverno is terminating, cleanup Kyverno resources") return true } - if deploy.Spec.Replicas == nil && *deploy.Spec.Replicas == 0 { + if deploy.Spec.Replicas != nil && *deploy.Spec.Replicas == 0 { logger.Info("Kyverno is scaled to zero, cleanup Kyverno resources") return true }