Skip to main content

☑️ Prevent Workflow from having an empty retry strategy

The user can specify a retryStrategy that will dictate how failed or errored steps are retried in a workflow. Providing an empty retryStrategy (i.e. retryStrategy: {}) will cause a container to retry until completion and eventually cause OOM issues.

Targeted objects by this rule (types of kind): Workflow

Complexity: medium (What does this mean?)

Policy as code identifier: ARGO_WORKFLOW_INCORRECT_RETRY_STRATEGY_VALUE_EMPTY


This rule will fail

If the retryStrategy key is set with an empty value {}:

kind: Workflow
spec:
  templates:
  - retryStrategy: {}

Rule output in the CLI

$ datree test *.yaml

>> File: failExample.yaml
❌ Prevent Workflow from having an empty retry strategy [1 occurrence]
💡 Incorrect value for key `retryStrategy` - empty value (`{}`) can cause failed/errored steps to keep retrying, which can result in OOM issues

How to fix this failure

Set the retryStrategy key with a non-empty value or don't set it at all:

kind: Workflow
spec:
  templates:
  - retryStrategy:
     limit: 10

Read more