Skip to content

Commit

Permalink
fix: Make kubectl plugin backwards compat with canary.stableRS (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
dthomson25 authored Apr 20, 2020
1 parent dbc2f5c commit e93c474
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pkg/kubectl-argo-rollouts/info/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ func TestRolloutStatusProgressing(t *testing.T) {
ro := newCanaryRollout()
ro.Status.StableRS = "abc1234"
ro.Status.CurrentPodHash = "def5678"
ro.Status.UpdatedReplicas = 4
ro.Status.AvailableReplicas = 4
assert.Equal(t, "Progressing", RolloutStatusString(ro))
}
{
ro := newCanaryRollout()
ro.Status.Canary.StableRS = "abc1234"
ro.Status.CurrentPodHash = "def5678"
ro.Status.UpdatedReplicas = 4
ro.Status.AvailableReplicas = 4
assert.Equal(t, "Progressing", RolloutStatusString(ro))
}
{
Expand Down
7 changes: 6 additions & 1 deletion pkg/kubectl-argo-rollouts/info/rollout_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ func RolloutStatusString(ro *v1alpha1.Rollout) string {
// old replicas are pending termination
return "Progressing"
}
if ro.Status.StableRS != "" && ro.Status.StableRS == ro.Status.CurrentPodHash {
stableRS := ro.Status.StableRS
//TODO(dthomson) Remove canary.stableRS for v0.9
if ro.Status.Canary.StableRS != "" {
stableRS = ro.Status.Canary.StableRS
}
if stableRS != "" && stableRS == ro.Status.CurrentPodHash {
return "Healthy"
}
// Waiting for rollout to finish steps
Expand Down

0 comments on commit e93c474

Please sign in to comment.