Skip to content

Commit

Permalink
Revert changes to mergeInLabelsIfDifferent.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Jan 8, 2024
1 parent 383068a commit 023bc9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/reconciliation/reconcile_racks.go
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ func (rc *ReconciliationContext) ReconcilePods(statefulSet *appsv1.StatefulSet)
return nil
}

func mergeInTagsIfDifferent(existingLabels, newLabels map[string]string) (bool, map[string]string) {
func mergeInLabelsIfDifferent(existingLabels, newLabels map[string]string) (bool, map[string]string) {
updatedLabels := utils.MergeMap(map[string]string{}, existingLabels, newLabels)
if reflect.DeepEqual(existingLabels, updatedLabels) {
return false, existingLabels
Expand All @@ -1689,15 +1689,15 @@ func mergeInTagsIfDifferent(existingLabels, newLabels map[string]string) (bool,
func shouldUpdateLabelsForClusterResource(resourceLabels map[string]string, dc *api.CassandraDatacenter) (bool, map[string]string) {
desired := dc.GetClusterLabels()
oplabels.AddOperatorLabels(desired, dc)
return mergeInTagsIfDifferent(resourceLabels, desired)
return mergeInLabelsIfDifferent(resourceLabels, desired)
}

// shouldUpdateLabelsForRackResource will compare the labels passed in with what the labels should be for a rack level
// resource. It will return the updated map and a boolean denoting whether the resource needs to be updated with the new labels.
func shouldUpdateLabelsForRackResource(resourceLabels map[string]string, dc *api.CassandraDatacenter, rackName string) (bool, map[string]string) {
desired := dc.GetRackLabels(rackName)
oplabels.AddOperatorLabels(desired, dc)
return mergeInTagsIfDifferent(resourceLabels, desired)
return mergeInLabelsIfDifferent(resourceLabels, desired)
}

func (rc *ReconciliationContext) labelServerPodStarting(pod *corev1.Pod) error {
Expand Down

0 comments on commit 023bc9e

Please sign in to comment.