Skip to content

Commit e75b4e7

Browse files
authored
Merge pull request #11350 from sbueringer/pr-fix-client-client
🐛 Fix RuntimeClient nil check in ClusterClass controller
2 parents f8a2970 + 7bde377 commit e75b4e7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/controllers/clusterclass/clusterclass_controller.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ type Reconciler struct {
7171
}
7272

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

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

0 commit comments

Comments
 (0)