From 278dbba316a3ff923590d5d27640d2c331ecf59e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Mon, 3 Oct 2022 15:48:34 +0200 Subject: [PATCH] fix: new cert manager controller never returns error (#4789) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché Signed-off-by: Charles-Edouard Brétéché --- cmd/kyverno/main.go | 6 +----- pkg/controllers/certmanager/controller.go | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cmd/kyverno/main.go b/cmd/kyverno/main.go index a0dd05bfe1..f40e0ddf69 100644 --- a/cmd/kyverno/main.go +++ b/cmd/kyverno/main.go @@ -393,11 +393,7 @@ func main() { logger.Error(err, "failed to initialize CertRenewer") os.Exit(1) } - certManager, err := certmanager.NewController(kubeKyvernoInformer.Core().V1().Secrets(), certRenewer) - if err != nil { - logger.Error(err, "failed to initialize CertManager") - os.Exit(1) - } + certManager := certmanager.NewController(kubeKyvernoInformer.Core().V1().Secrets(), certRenewer) webhookController := webhookcontroller.NewController( metrics.ObjectClient[*corev1.Secret]( diff --git a/pkg/controllers/certmanager/controller.go b/pkg/controllers/certmanager/controller.go index cdfc8481bf..a0134853c6 100644 --- a/pkg/controllers/certmanager/controller.go +++ b/pkg/controllers/certmanager/controller.go @@ -33,7 +33,7 @@ type controller struct { secretQueue chan bool } -func NewController(secretInformer corev1informers.SecretInformer, certRenewer *tls.CertRenewer) (Controller, error) { +func NewController(secretInformer corev1informers.SecretInformer, certRenewer *tls.CertRenewer) Controller { manager := &controller{ renewer: certRenewer, secretLister: secretInformer.Lister(), @@ -44,7 +44,7 @@ func NewController(secretInformer corev1informers.SecretInformer, certRenewer *t AddFunc: manager.addSecretFunc, UpdateFunc: manager.updateSecretFunc, }) - return manager, nil + return manager } func (m *controller) Run(ctx context.Context, workers int) {