Skip to content

Commit 9cae38d

Browse files
committed
swap deletion and insertion order
1 parent 2930b09 commit 9cae38d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/cluster/sync.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -569,15 +569,6 @@ func (c *Cluster) checkAndSetGlobalPostgreSQLConfiguration(pod *v1.Pod, effectiv
569569
}
570570

571571
slotsToSet := make(map[string]interface{})
572-
// check if specified slots exist in config and if they differ
573-
for slotName, desiredSlot := range desiredPatroniConfig.Slots {
574-
if effectiveSlot, exists := effectivePatroniConfig.Slots[slotName]; exists {
575-
if reflect.DeepEqual(desiredSlot, effectiveSlot) {
576-
continue
577-
}
578-
}
579-
slotsToSet[slotName] = desiredSlot
580-
}
581572
// check if there is any slot deletion
582573
for slotName, effectiveSlot := range effectivePatroniConfig.Slots {
583574
if desiredSlot, exists := desiredPatroniConfig.Slots[slotName]; exists {
@@ -587,6 +578,15 @@ func (c *Cluster) checkAndSetGlobalPostgreSQLConfiguration(pod *v1.Pod, effectiv
587578
}
588579
slotsToSet[slotName] = nil
589580
}
581+
// check if specified slots exist in config and if they differ
582+
for slotName, desiredSlot := range desiredPatroniConfig.Slots {
583+
if effectiveSlot, exists := effectivePatroniConfig.Slots[slotName]; exists {
584+
if reflect.DeepEqual(desiredSlot, effectiveSlot) {
585+
continue
586+
}
587+
}
588+
slotsToSet[slotName] = desiredSlot
589+
}
590590
if len(slotsToSet) > 0 {
591591
configToSet["slots"] = slotsToSet
592592
}

0 commit comments

Comments
 (0)