Skip to content

Commit c25281e

Browse files
committed
fix: add nil checks to prevent unit tests from failing
1 parent f788c60 commit c25281e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/notebook-controller/controllers/notebook_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (r *NotebookReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
162162

163163
// Copy the pod template labels, but reconcilation is not required
164164
// exclusively based on ths pod template labels
165-
if *ss.Spec.Replicas != *foundStateful.Spec.Replicas {
165+
if ss.Spec.Replicas != nil && foundStateful.Spec.Replicas != nil && *ss.Spec.Replicas != *foundStateful.Spec.Replicas {
166166
if !reflect.DeepEqual(foundStateful.Spec.Template.ObjectMeta.Labels, ss.Spec.Template.ObjectMeta.Labels) {
167167
foundStateful.Spec.Template.ObjectMeta.Labels = ss.Spec.Template.ObjectMeta.Labels
168168
}

0 commit comments

Comments
 (0)