diff --git a/internal/certmanager/verifier.go b/internal/certmanager/verifier.go index 75b9f903e..e41e192fc 100644 --- a/internal/certmanager/verifier.go +++ b/internal/certmanager/verifier.go @@ -22,7 +22,8 @@ import ( "k8s.io/client-go/rest" ) -func VerifyAPI(ctx context.Context, restcfg *rest.Config, scheme *runtime.Scheme, namespace string) error { +func VerifyAPI(ctx context.Context, restcfg *rest.Config, namespace string) error { + scheme := runtime.NewScheme() checker, err := cmapichecker.New(restcfg, scheme, namespace) if err != nil { return err diff --git a/internal/controller/management_controller.go b/internal/controller/management_controller.go index c2b4e2c5b..5d4b324a9 100644 --- a/internal/controller/management_controller.go +++ b/internal/controller/management_controller.go @@ -384,7 +384,7 @@ func (r *ManagementReconciler) enableAdditionalComponents(ctx context.Context, m capiOperatorValues = v } - err := certmanager.VerifyAPI(ctx, r.Config, r.Scheme, r.SystemNamespace) + err := certmanager.VerifyAPI(ctx, r.Config, r.SystemNamespace) if err != nil { return fmt.Errorf("failed to check in the cert-manager API is installed: %v", err) }