Skip to content

Commit d95fb01

Browse files
fix podopslifecycle set readiness gate order (#298)
1 parent e4e981f commit d95fb01

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/controllers/podopslifecycle/podopslifecycle_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,11 @@ func (r *ReconcilePodOpsLifecycle) Reconcile(ctx context.Context, request reconc
185185
v1alpha1.PodPreparingLabelPrefix: false, // Set readiness gate to false
186186
v1alpha1.PodCompletingLabelPrefix: true, // Set readiness gate to true
187187
}
188-
for phaseLabel, expectedReadinessGateStatus := range expected {
188+
// preparing phase goes before completing phase
189+
orderedKeys := []string{v1alpha1.PodPreparingLabelPrefix, v1alpha1.PodCompletingLabelPrefix}
190+
for _, phaseLabel := range orderedKeys {
189191
keeped := false
192+
expectedReadinessGateStatus := expected[phaseLabel]
190193
for _, labels := range idToLabelsMap {
191194
if _, ok := labels[phaseLabel]; !ok {
192195
continue

0 commit comments

Comments
 (0)