Skip to content

Commit

Permalink
Update rollout healthcheck to use pause conditons (argoproj#2842)
Browse files Browse the repository at this point in the history
  • Loading branch information
dthomson25 authored Dec 10, 2019
1 parent 14d0e76 commit c3ed032
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 202 deletions.
13 changes: 5 additions & 8 deletions resource_customizations/argoproj.io/Rollout/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,13 @@ end

function checkPaused(obj)
hs = {}
local paused = false
if obj.status.verifyingPreview ~= nil then
paused = obj.status.verifyingPreview
elseif obj.spec.paused ~= nil then
paused = obj.spec.paused
hs.status = "Suspended"
hs.message = "Rollout is paused"
if obj.status.pauseConditions ~= nil and table.getn(obj.status.pauseConditions) > 0 then
return hs
end

if paused then
hs.status = "Suspended"
hs.message = "Rollout is paused"
if obj.spec.paused ~= nil and obj.spec.paused then
return hs
end
return nil
Expand Down
14 changes: 5 additions & 9 deletions resource_customizations/argoproj.io/Rollout/health_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ tests:
status: Healthy
message: The active Service is serving traffic to the current pod spec
inputPath: testdata/bluegreen/healthy_servingActiveService.yaml
- healthStatus:
status: Suspended
message: Rollout is paused
inputPath: testdata/bluegreen/suspended_servingPreviewService.yaml
- healthStatus:
status: Suspended
message: Rollout is paused
inputPath: testdata/v0.2_suspended_servingPreviewService.yaml
- healthStatus:
status: Progressing
message: "Waiting for roll out to finish: More replicas need to be updated"
Expand All @@ -48,7 +40,11 @@ tests:
- healthStatus:
status: Suspended
message: Rollout is paused
inputPath: testdata/canary/suspended_pausedStep.yaml
inputPath: testdata/suspended_controllerPause.yaml
- healthStatus:
status: Suspended
message: Rollout is paused
inputPath: testdata/suspended_userPause.yaml
- healthStatus:
status: Healthy
message: The rollout has completed all steps
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: canary-demo
namespace: default
spec:
replicas: 5
revisionHistoryLimit: 1
selector:
matchLabels:
app: canary-demo
strategy:
canary:
canaryService: canary-demo-preview
steps:
- setWeight: 20
- pause: {}
template:
metadata:
creationTimestamp: null
labels:
app: canary-demo
spec:
containers:
- image: argoproj/rollouts-demo:yellow
imagePullPolicy: Always
name: canary-demo
status:
HPAReplicas: 5
availableReplicas: 5
blueGreen: {}
canary:
stableRS: 75c96899b8
conditions:
- lastTransitionTime: "2019-12-09T18:34:12Z"
lastUpdateTime: "2019-12-09T18:34:12Z"
message: Rollout is paused
reason: RolloutPaused
status: Unknown
type: Progressing
controllerPause: true
currentPodHash: 6758949f55
currentStepHash: f64cdc9d
currentStepIndex: 1
observedGeneration: 5b9f9dd6c6
pauseConditions:
- reason: CanaryPauseStep
startTime: "2019-12-09T18:34:12Z"
readyReplicas: 5
replicas: 5
selector: app=canary-demo
updatedReplicas: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: example-rollout-canary
namespace: default
spec:
paused: true
replicas: 5
selector:
matchLabels:
app: guestbook
strategy:
canary:
steps:
- setWeight: 20
- pause: {}
template:
metadata:
labels:
app: guestbook
spec:
containers:
- image: gcr.io/heptio-images/ks-guestbook-demo:0.2
name: guestbook
status:
HPAReplicas: 5
availableReplicas: 5
blueGreen: {}
canary:
stableRS: df986d68
conditions:
- lastTransitionTime: 2019-04-26T20:18:38Z
lastUpdateTime: 2019-04-26T20:18:38Z
message: Rollout is paused
reason: RolloutPaused
status: Unknown
type: Progressing
currentPodHash: 6b566f47b7
currentStepHash: 6567fc959c
currentStepIndex: 1
observedGeneration: 5c788f4484
pauseStartTime: 2019-04-26T20:18:38Z
readyReplicas: 5
replicas: 5
selector: app=guestbook
updatedReplicas: 1

This file was deleted.

0 comments on commit c3ed032

Please sign in to comment.