Skip to content

Commit

Permalink
fix: stuck rollout when rollout is paused
Browse files Browse the repository at this point in the history
Signed-off-by: asingh51 <[email protected]>

fix: stuck rollout when rollout is paused

Signed-off-by: asingh51 <[email protected]>

fix: stuck rollout when rollout is paused

Signed-off-by: asingh51 <[email protected]>

fix: stuck rollout when rollout is paused

Signed-off-by: asingh51 <[email protected]>

fix: stuck rollout when rollout is paused

Signed-off-by: asingh51 <[email protected]>

fix: stuck rollout when rollout is paused

Signed-off-by: asingh51 <[email protected]>

fix: stuck rollout when rollout is paused

Signed-off-by: asingh51 <[email protected]>
  • Loading branch information
asingh51 committed Feb 8, 2024
1 parent 7bb1f84 commit 99e2cdf
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 131 deletions.
48 changes: 8 additions & 40 deletions test/e2e/canary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,40 +415,7 @@ spec:

func (s *CanarySuite) TestCanaryProgressDeadlineExceededWithPause() {
s.Given().
RolloutObjects(`
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollout-canary-with-pause
spec:
replicas: 3
revisionHistoryLimit: 2
progressDeadlineSeconds: 5
selector:
matchLabels:
app: rollout-canary-with-pause
template:
metadata:
labels:
app: rollout-canary-with-pause
spec:
containers:
- name: rollouts-demo
image: nginx:1.19-alpine
ports:
- containerPort: 80
readinessProbe:
initialDelaySeconds: 10
httpGet:
path: /
port: 80
periodSeconds: 30
strategy:
canary:
steps:
- setWeight: 20
- pause: {}
`).
RolloutObjects(`@functional/rollout-canary-with-pause.yaml`).
When().
ApplyManifests().
WaitForRolloutStatus("Degraded").
Expand Down Expand Up @@ -565,21 +532,22 @@ func (s *CanarySuite) TestCanaryScaleDownOnAbortNoTrafficRouting() {
ExpectRevisionPodCount("2", 0)
}

func (s *CanarySuite) TestCanaryWhenRolloutPaused() {
s.Given().
HealthyRollout(`@functional/canary-deploy-new-rev-on-paused-rollout.yaml`).
func (s *CanarySuite) TestCanaryWithPausedRollout() {
(s.Given().
HealthyRollout(`@functional/rollout-canary-with-pause.yaml`).
When().
UpdateSpec(). // update to revision 2
WaitForRolloutStatus("Paused").
UpdateSpec(). // update to revision 3
WaitForRolloutStatus("Healthy").
WaitForRolloutStatus("Paused").
Then().
// Expect that the canary service selector has been moved back to stable
ExpectServiceSelector("canary-next-canary", map[string]string{"app": "canary-next-canary", "rollouts-pod-template-hash": "66597877b7"}, false).
ExpectServiceSelector("rollout-canary-with-pause-canary", map[string]string{"app": "rollout-canary-with-pause", "rollouts-pod-template-hash": "66597877b7"}, false).
When().
Sleep(3*time.Second).
Then().
ExpectRevisionPodCount("2", 0)
ExpectRevisionPodCount("2", 0).
ExpectRevisionPodCount("3", 1))
}

func (s *CanarySuite) TestCanaryUnScaleDownOnAbort() {
Expand Down
91 changes: 0 additions & 91 deletions test/e2e/functional/canary-deploy-new-rev-on-paused-rollout.yaml

This file was deleted.

75 changes: 75 additions & 0 deletions test/e2e/functional/rollout-canary-with-pause.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
apiVersion: v1
kind: Service
metadata:
name: rollout-canary-with-pause-root
spec:
type: NodePort
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: rollout-canary-with-pause
---
apiVersion: v1
kind: Service
metadata:
name: rollout-canary-with-pause-canary
spec:
type: NodePort
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: rollout-canary-with-pause
---
apiVersion: v1
kind: Service
metadata:
name: rollout-canary-with-pause-stable
spec:
type: NodePort
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: rollout-canary-with-pause
---

apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rollout-canary-with-pause
spec:
replicas: 3
revisionHistoryLimit: 2
progressDeadlineSeconds: 5
selector:
matchLabels:
app: rollout-canary-with-pause
template:
metadata:
labels:
app: rollout-canary-with-pause
spec:
containers:
- name: rollouts-demo
image: nginx:1.19-alpine
ports:
- containerPort: 80
readinessProbe:
initialDelaySeconds: 10
httpGet:
path: /
port: 80
periodSeconds: 30
strategy:
canary:
steps:
- setWeight: 20
- pause: {}

0 comments on commit 99e2cdf

Please sign in to comment.