From 0694585d723a0475108597e93b04c56a845a46e9 Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Thu, 4 Mar 2021 13:24:45 +0000 Subject: [PATCH] Phrase the message template example as YAML not go The message template is used in YAML files, not in go code. Signed-off-by: Michael Bridgen --- docs/spec/v1alpha1/imageupdateautomations.md | 43 ++++++++++---------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/docs/spec/v1alpha1/imageupdateautomations.md b/docs/spec/v1alpha1/imageupdateautomations.md index 6fe31da9..23296fc1 100644 --- a/docs/spec/v1alpha1/imageupdateautomations.md +++ b/docs/spec/v1alpha1/imageupdateautomations.md @@ -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