Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix RuntimeClient nil check in ClusterClass controller #11350

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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