Skip to content

Commit

Permalink
Merge pull request #2851 from malayparida2000/noobaa_affinity
Browse files Browse the repository at this point in the history
Clear the affinity on Noobaa if it was set previously to handle upgrades
  • Loading branch information
openshift-merge-bot[bot] authored Oct 15, 2024
2 parents fa5b5bf + b8a230f commit 4eacb19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/storagecluster/noobaa_system_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,15 @@ func (r *StorageClusterReconciler) setNooBaaDesiredState(nb *nbv1.NooBaa, sc *oc
placement := getPlacement(sc, component)

nb.Spec.Tolerations = placement.Tolerations
// if we are "noobaa-standalone" and placement is not set - don't set affinity

if !r.IsNoobaaStandalone || ok {
// Add affinity if not in noobaa-standalone mode or if placement is specified
nb.Spec.Affinity = &corev1.Affinity{NodeAffinity: placement.NodeAffinity}
} else if nb.Spec.Affinity != nil {
// Clear the affinity if it was set previously to handle upgrades
nb.Spec.Affinity = nil
}

nb.Spec.DBVolumeResources = &corev1.VolumeResourceRequirements{
Limits: dBVolumeResources.Limits,
Requests: dBVolumeResources.Requests,
Expand Down

0 comments on commit 4eacb19

Please sign in to comment.