Skip to content

Commit

Permalink
Fix race caused by Scheme update
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Pavlov <[email protected]>
  • Loading branch information
Kshatrix committed Oct 30, 2024
1 parent 225edee commit dc2991c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/certmanager/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/management_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit dc2991c

Please sign in to comment.