Skip to content

Commit

Permalink
Merge pull request #11350 from sbueringer/pr-fix-client-client
Browse files Browse the repository at this point in the history
🐛 Fix RuntimeClient nil check in ClusterClass controller
  • Loading branch information
k8s-ci-robot authored Oct 30, 2024
2 parents f8a2970 + 7bde377 commit e75b4e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/controllers/clusterclass/clusterclass_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ type Reconciler struct {
}

func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
if r.Client == nil || r.RuntimeClient == nil {
return errors.New("Client and RuntimeClient must not be nil")
if r.Client == nil {
return errors.New("Client must not be nil")
}
if feature.Gates.Enabled(feature.RuntimeSDK) && r.RuntimeClient == nil {
return errors.New("RuntimeClient must not be nil")
}

predicateLog := ctrl.LoggerFrom(ctx).WithValues("controller", "clusterclass")
Expand Down

0 comments on commit e75b4e7

Please sign in to comment.