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) {