Skip to content

Commit 2b18799

Browse files
authored
[release-1.17] Assigned 0% to the new revision even before any pod is ready (#366)
1 parent abc2ee2 commit 2b18799

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/reconciler/service/service.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,12 +998,16 @@ func convertIntoTrafficTarget(name string, ro *v1.RolloutOrchestrator, rc *Rollo
998998
revisionTarget[index].LatestRevision = ptr.Bool(false)
999999
}
10001000

1001-
if !found && spa != nil && spa.Status.ActualScale != nil && *spa.Status.ActualScale > 0 {
1001+
if !found {
10021002
// We must assign the traffic to the new revision, even of it is 0%. Otherwise, the PA will
10031003
// sometimes report the error of "No traffic. The target is not receiving traffic", which
10041004
// will kill the pods of the new revision during the progressive rollout.
10051005
// The last one of ro.Spec.StageTargetRevisions is certainly the RevisionTarget for the
10061006
// new revision.
1007+
// Even if the number of the pod for the new revision does not reach 1, assigning 0% to the empty
1008+
// revision will lead to "100% assigned to the old and 0% assigned to the old as well". Istio/Envoy
1009+
// will pick up the higher value as priority, so there is still 100% traffic assigned to the old
1010+
// revision.
10071011
newRevisionTarget := ro.Spec.StageTargetRevisions[len(ro.Spec.StageTargetRevisions)-1]
10081012
newRevisionTarget.Percent = ptr.Int64(int64(0))
10091013
revisionTarget = append(revisionTarget, newRevisionTarget)

0 commit comments

Comments
 (0)