Skip to content

Commit c0a4c10

Browse files
committed
fix rollout controller not rollout when type is changed from External to RollingUpdate
Signed-off-by: Wantong Jiang <[email protected]>
1 parent 9987f94 commit c0a4c10

File tree

2 files changed

+227
-166
lines changed

2 files changed

+227
-166
lines changed

pkg/controllers/rollout/controller.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,15 @@ func handleCRP(newCRPObj, oldCRPObj client.Object, q workqueue.TypedRateLimiting
10951095
return
10961096
}
10971097

1098+
// Check if the rollout strategy type has been updated.
1099+
if newCRP.Spec.Strategy.Type != oldCRP.Spec.Strategy.Type {
1100+
klog.V(2).InfoS("Detected an update to the rollout strategy type on the CRP", "clusterResourcePlacement", klog.KObj(newCRP))
1101+
q.Add(reconcile.Request{
1102+
NamespacedName: types.NamespacedName{Name: newCRP.GetName()},
1103+
})
1104+
return
1105+
}
1106+
10981107
// Check if the apply strategy has been updated.
10991108
newApplyStrategy := newCRP.Spec.Strategy.ApplyStrategy
11001109
oldApplyStrategy := oldCRP.Spec.Strategy.ApplyStrategy
@@ -1103,6 +1112,7 @@ func handleCRP(newCRPObj, oldCRPObj client.Object, q workqueue.TypedRateLimiting
11031112
q.Add(reconcile.Request{
11041113
NamespacedName: types.NamespacedName{Name: newCRP.GetName()},
11051114
})
1115+
return
11061116
}
11071117

11081118
klog.V(2).InfoS("No update to apply strategy detected; ignore the CRP Update event", "clusterResourcePlacement", klog.KObj(newCRP))

0 commit comments

Comments
 (0)