diff --git a/components/notebook-controller/controllers/notebook_controller.go b/components/notebook-controller/controllers/notebook_controller.go index 9f8c4b62f47..09ecff5dd2e 100644 --- a/components/notebook-controller/controllers/notebook_controller.go +++ b/components/notebook-controller/controllers/notebook_controller.go @@ -162,7 +162,7 @@ func (r *NotebookReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c // Copy the pod template labels, but reconcilation is not required // exclusively based on ths pod template labels - if *ss.Spec.Replicas != *foundStateful.Spec.Replicas { + if ss.Spec.Replicas != nil && foundStateful.Spec.Replicas != nil && *ss.Spec.Replicas != *foundStateful.Spec.Replicas { if !reflect.DeepEqual(foundStateful.Spec.Template.ObjectMeta.Labels, ss.Spec.Template.ObjectMeta.Labels) { foundStateful.Spec.Template.ObjectMeta.Labels = ss.Spec.Template.ObjectMeta.Labels }