Skip to content

Commit

Permalink
Phrase the message template example as YAML not go
Browse files Browse the repository at this point in the history
The message template is used in YAML files, not in go code.

Signed-off-by: Michael Bridgen <michael@weave.works>
  • Loading branch information
squaremo committed Mar 4, 2021
1 parent 2eebaa4 commit 0694585
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions docs/spec/v1alpha1/imageupdateautomations.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,27 +231,28 @@ func (r Result) Objects() map[ObjectIdentifier][]ImageRef {
The methods let you range over the objects and images without descending the data structure. Here's
an example of using the fields and methods in a template:

```go
commitTemplate := `
`Automated image update
Automation name: {{ .AutomationObject }}
Files:
{{ range $filename, $_ := .Updated.Files -}}
- {{ $filename }}
{{ end -}}
Objects:
{{ range $resource, $_ := .Updated.Objects -}}
- {{ $resource.Kind }} {{ $resource.Name }}
{{ end -}}
Images:
{{ range .Updated.Images -}}
- {{.}}
{{ end -}}
`
```yaml
spec:
commit:
messsageTemplate: |
Automated image update
Automation name: {{ .AutomationObject }}
Files:
{{ range $filename, $_ := .Updated.Files -}}
- {{ $filename }}
{{ end -}}
Objects:
{{ range $resource, $_ := .Updated.Objects -}}
- {{ $resource.Kind }} {{ $resource.Name }}
{{ end -}}
Images:
{{ range .Updated.Images -}}
- {{.}}
{{ end -}}
```

## Status
Expand Down

0 comments on commit 0694585

Please sign in to comment.