☑️ Ensure Rollout pause step has a configured duration
Users can define a list of steps the controller uses to manipulate the ReplicaSets during the rollout. Each step can have one of two fields.
The setWeight
field dictates the percentage of traffic that should be sent to the canary, and the pause
struct instructs the rollout to pause.
When the controller reaches a pause step for a rollout, it will set adds a PauseCondition struct to the .status.PauseConditions
field. If the duration field within the pause struct is set, the rollout will not progress to the next step until it has waited for the value of the duration
field. Otherwise, the rollout will wait indefinitely until that Pause condition is removed.
By using the setWeight
and the pause
fields, a user can declaratively describe how they want to progress to the new version.
Targeted objects by this rule (types of kind): Rollout
Complexity: easy (What does this mean?)
Policy as code identifier: ARGO_ROLLOUT_MISSING_PAUSE_DURATION
This rule will fail
If the duration
key is not set:
kind: Rollout
spec:
strategy:
canary:
steps:
- pause: {}
Rule output in the CLI
$ datree test *.yaml
>> File: failExample.yaml
❌ Ensure Rollout pause step has a configured duration [1 occurrence]
💡 Missing the key `duration` - prevent the rollout from waiting indefinitely for the pause condition
How to fix this failure
Set the duration
key and give it a value:
kind: Rollout
spec:
strategy:
canary:
steps:
- pause:
duration: 1h # 1 hour