Skip to content

Commit 9f61997

Browse files
committed
nil checking short circuit
1 parent 62dcdb6 commit 9f61997

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/ext-proc/backend/inferencepool_reconciler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (c *InferencePoolReconciler) Reconcile(ctx context.Context, req ctrl.Reques
3535
klog.Error(err, "unable to get InferencePool")
3636
return ctrl.Result{}, err
3737
}
38-
if !reflect.DeepEqual(serverPool.Spec.Selector, c.Datastore.inferencePool.Spec.Selector) {
38+
if c.Datastore.inferencePool == nil || !reflect.DeepEqual(serverPool.Spec.Selector, c.Datastore.inferencePool.Spec.Selector) {
3939
c.Datastore.flushPodsAndRefetch(ctx, c.Client, serverPool)
4040
}
4141
c.updateDatastore(serverPool)

0 commit comments

Comments
 (0)