Skip to content

Commit

Permalink
fix: add nil checks to prevent unit tests from failing
Browse files Browse the repository at this point in the history
  • Loading branch information
rkpattnaik780 authored and openshift-cherrypick-robot committed Apr 12, 2024
1 parent daac703 commit 4f29d67
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 4f29d67

Please sign in to comment.