Skip to content

Commit ceab066

Browse files
authored
Merge pull request #11426 from Nordix/lentzi90/fix-runtime-client-nil-check
🐛 Fix RuntimeClient nil check in Cluster controller
2 parents a9fef8e + 4c0a10e commit ceab066

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/controllers/topology/cluster/cluster_controller.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,12 @@ type Reconciler struct {
9494
}
9595

9696
func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
97-
if r.Client == nil || r.APIReader == nil || r.ClusterCache == nil || r.RuntimeClient == nil {
98-
return errors.New("Client, APIReader, ClusterCache and RuntimeClient must not be nil")
97+
if r.Client == nil || r.APIReader == nil || r.ClusterCache == nil {
98+
return errors.New("Client, APIReader and ClusterCache must not be nil")
99+
}
100+
101+
if feature.Gates.Enabled(feature.RuntimeSDK) && r.RuntimeClient == nil {
102+
return errors.New("RuntimeClient must not be nil")
99103
}
100104

101105
r.predicateLog = ctrl.LoggerFrom(ctx).WithValues("controller", "topology/cluster")

0 commit comments

Comments
 (0)