diff --git a/Makefile b/Makefile index c550096517..dbbe4e0351 100644 --- a/Makefile +++ b/Makefile @@ -646,6 +646,14 @@ release-notes: @bash -c 'while IFS= read -r line ; do if [[ "$$line" == "## "* && "$$line" != "## $(VERSION)" ]]; then break ; fi; echo "$$line"; done < "CHANGELOG.md"' \ true +######### +# DEBUG # +######### + +.PHONY: debug-deploy +debug-deploy: codegen-install ## Install debug manifests + @kubectl create -f ./config/install_debug.yaml || kubectl replace -f ./config/install_debug.yaml + ########## # GITHUB # ########## diff --git a/cmd/kyverno/main.go b/cmd/kyverno/main.go index 0fe340fd77..b4f21b2267 100644 --- a/cmd/kyverno/main.go +++ b/cmd/kyverno/main.go @@ -606,7 +606,7 @@ func main() { go configurationController.Run(signalCtx, configcontroller.Workers) go eventGenerator.Run(signalCtx, 3) - if serverIP != "" { + if serverIP == "" { go webhookMonitor.Run(signalCtx, webhookCfg, certRenewer, eventGenerator) } diff --git a/pkg/webhookconfig/registration.go b/pkg/webhookconfig/registration.go index f6765b3174..71564ce6f5 100644 --- a/pkg/webhookconfig/registration.go +++ b/pkg/webhookconfig/registration.go @@ -127,6 +127,7 @@ func (wrc *Register) Register() error { logger := wrc.log if wrc.serverIP != "" { logger.Info("Registering webhook", "url", fmt.Sprintf("https://%s", wrc.serverIP)) + } else { if err := wrc.checkEndpoint(); err != nil { return err } @@ -243,12 +244,15 @@ func (wrc *Register) UpdateWebhookConfigurations(configHandler config.Configurat logger.V(4).Info("received the signal to update webhook configurations") retry := false - deploy, err := wrc.GetKubePolicyDeployment() - if err != nil { - retry = true - } - if tlsutils.IsKyvernoInRollingUpdate(deploy) { - retry = true + if wrc.serverIP != "" { + deploy, err := wrc.GetKubePolicyDeployment() + if err != nil { + retry = true + } else { + if tlsutils.IsKyvernoInRollingUpdate(deploy) { + retry = true + } + } } if !retry {