Skip to content

Commit

Permalink
docs: fix doc for valueFrom fields for analysis args
Browse files Browse the repository at this point in the history
Signed-off-by: hari rongali <[email protected]>
  • Loading branch information
harikrongali committed Jan 12, 2022
1 parent 4739bcd commit bf3b7cc
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions docs/features/analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ spec:
valueFrom:
podTemplateHashValue: Latest
```
Analysis arguments also support valueFrom for reading any Rollout fields and passing them as arguments to AnalysisTemplate.
An example would be to reference metadata labels like env and region and passing them along to AnalysisTemplate, or any field
from the Rollout status
Analysis arguments also support valueFrom for reading metadata fields and passing them as arguments to AnalysisTemplate.
An example would be to reference metadata labels like env and region and passing them along to AnalysisTemplate.

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Rollout
Expand Down Expand Up @@ -464,6 +464,38 @@ spec:
fieldPath: status.canary.weights.canary.podTemplateHash
```

!!! important
Available since v1.2
Analysis arguments also support valueFrom for reading any Rollout fields and passing them as arguments to AnalysisTemplate.
Following example references Rollout status field like podTemplateHash and passing them along to AnalysisTemplate

from the Rollout status
```yaml
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: guestbook
labels:
appType: demo-app
buildType: nginx-app
...
env: dev
region: us-west-2
spec:
...
strategy:
canary:
analysis:
templates:
- templateName: args-example
args:
...
- name: canary-hash
valueFrom:
fieldRef:
fieldPath: status.canary.weights.canary.podTemplateHash
```

## BlueGreen Pre Promotion Analysis

A Rollout using the BlueGreen strategy can launch an AnalysisRun *before* it switches traffic to the new version using
Expand Down

0 comments on commit bf3b7cc

Please sign in to comment.