Skip to content

Commit b91732a

Browse files
authored
fix: rollout v1.0 'Paused' status.phase should map to Argo CD 'Suspended' (argoproj#6967)
Signed-off-by: Jesse Suen <[email protected]>
1 parent 97e8c7d commit b91732a

File tree

3 files changed

+107
-1
lines changed

3 files changed

+107
-1
lines changed

resource_customizations/argoproj.io/Rollout/health.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ end
8787

8888
-- Argo Rollouts v1.0 has been improved to record a phase/message in status, which Argo CD can blindly surface
8989
if obj.status.phase ~= nil then
90-
hs.status = obj.status.phase
90+
if obj.status.phase == "Paused" then
91+
-- Map Rollout's "Paused" status to Argo CD's "Suspended"
92+
hs.status = "Suspended"
93+
else
94+
hs.status = obj.status.phase
95+
end
9196
hs.message = obj.status.message
9297
return hs
9398
end

resource_customizations/argoproj.io/Rollout/health_test.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ tests:
7272
status: Suspended
7373
message: Rollout is paused
7474
inputPath: testdata/suspended_userPause.yaml
75+
- healthStatus:
76+
status: Suspended
77+
message: CanaryPauseStep
78+
inputPath: testdata/suspended_v1.0_pausedRollout.yaml
7579
- healthStatus:
7680
status: Healthy
7781
inputPath: testdata/canary/healthy_executedAllStepsPreV0.8.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Rollout
3+
metadata:
4+
annotations:
5+
rollout.argoproj.io/revision: '2'
6+
creationTimestamp: '2021-06-30T04:40:44Z'
7+
generation: 5
8+
labels:
9+
app.kubernetes.io/instance: rollouts-demo
10+
name: rollouts-demo
11+
namespace: rollouts-demo
12+
resourceVersion: '4838641'
13+
uid: bf946046-d90e-49b9-863c-76f82bed3b31
14+
spec:
15+
replicas: 5
16+
revisionHistoryLimit: 1
17+
selector:
18+
matchLabels:
19+
app: rollouts-demo
20+
strategy:
21+
canary:
22+
canaryService: rollouts-demo-desired
23+
stableService: rollouts-demo-stable
24+
steps:
25+
- setWeight: 21
26+
- pause: {}
27+
- setWeight: 40
28+
- pause:
29+
duration: 10
30+
- setWeight: 60
31+
- pause:
32+
duration: 10
33+
- setWeight: 80
34+
- pause:
35+
duration: 10
36+
template:
37+
metadata:
38+
labels:
39+
app: rollouts-demo
40+
spec:
41+
containers:
42+
- image: 'argoproj/rollouts-demo:yellow'
43+
imagePullPolicy: Always
44+
name: rollouts-demo
45+
ports:
46+
- containerPort: 8080
47+
name: http
48+
protocol: TCP
49+
resources:
50+
requests:
51+
cpu: 5m
52+
memory: 32Mi
53+
status:
54+
HPAReplicas: 6
55+
availableReplicas: 6
56+
blueGreen: {}
57+
canary: {}
58+
conditions:
59+
- lastTransitionTime: '2021-06-30T05:01:22Z'
60+
lastUpdateTime: '2021-06-30T05:01:22Z'
61+
message: RolloutCompleted
62+
reason: RolloutCompleted
63+
status: 'False'
64+
type: Completed
65+
- lastTransitionTime: '2021-06-30T05:01:27Z'
66+
lastUpdateTime: '2021-06-30T05:01:27Z'
67+
message: Rollout has minimum availability
68+
reason: AvailableReason
69+
status: 'True'
70+
type: Available
71+
- lastTransitionTime: '2021-07-15T21:08:55Z'
72+
lastUpdateTime: '2021-07-15T21:08:55Z'
73+
message: Rollout is paused
74+
reason: RolloutPaused
75+
status: Unknown
76+
type: Progressing
77+
- lastTransitionTime: '2021-07-15T21:08:55Z'
78+
lastUpdateTime: '2021-07-15T21:08:55Z'
79+
message: Rollout is paused
80+
reason: RolloutPaused
81+
status: 'True'
82+
type: Paused
83+
controllerPause: true
84+
currentPodHash: 8566c77b97
85+
currentStepHash: 7d5979db69
86+
currentStepIndex: 1
87+
message: CanaryPauseStep
88+
observedGeneration: '5'
89+
pauseConditions:
90+
- reason: CanaryPauseStep
91+
startTime: '2021-07-15T21:08:55Z'
92+
phase: Paused
93+
readyReplicas: 6
94+
replicas: 6
95+
selector: app=rollouts-demo
96+
stableRS: 77f4f8ff97
97+
updatedReplicas: 2

0 commit comments

Comments
 (0)