Skip to content

Commit

Permalink
fix(update-methods.md): escape characters in annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Luke McKechnie <[email protected]>
  • Loading branch information
Luke McKechnie authored and galamdring committed Oct 15, 2024
1 parent 02eee1d commit f1976ce
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/basics/update-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ By default Argo CD Image Updater re-uses the credentials you have configured
in Argo CD for accessing the repository.

If you don't want to use credentials configured for Argo CD you can use other credentials stored in a Kubernetes secret,
which needs to be accessible by the Argo CD Image Updater's Service Account. The secret should be specified in
which needs to be accessible by the Argo CD Image Updater's Service Account. The secret should be specified in
`argocd-image-updater.argoproj.io/write-back-method` annotation using `git:<credref>` format. Where `<credref>` might
take one of following values:

Expand Down Expand Up @@ -161,7 +161,7 @@ kubectl -n argocd-image-updater create secret generic git-creds \
By default, Argo CD Image Updater will use the value found in the Application
spec at `.spec.source.repoURL` as Git repository to checkout. But when using
a Helm repository as `.spec.source.repoURL` GIT will simply fail. To manually
specify the repository to push the changes, specify the
specify the repository to push the changes, specify the
annotation `argocd-image-updater.argoproj.io/git-repository` on the Application
manifest.

Expand Down Expand Up @@ -214,8 +214,10 @@ the annotation. For example, the following would create a branch named
`image-updater-foo/bar-1.1` based on `main` in the event an image with
the name `foo/bar` was updated to the new tag `1.1`.

Helm will try to consume this template unless you escape the opening and closing brackets.

```yaml
argocd-image-updater.argoproj.io/git-branch: main:image-updater{{range .Images}}-{{.Name}}-{{.NewTag}}{{end}}
argocd-image-updater.argoproj.io/git-branch: main:image-updater{{"{{"}}range .Images{{"}}"}}-{{"{{"}}.Name{{"}}"}}-{{"{{"}}.NewTag{{"}}"}}{{"{{"}}end{{"}}"}}
```

Alternatively, to assure unique branch names you could use the SHA1 representation of the changes:
Expand Down Expand Up @@ -349,7 +351,7 @@ You may also specify which kustomization to update with either a path relative t

```yaml
argocd-image-updater.argoproj.io/write-back-target: "kustomization:../../base"
# if the Application spec.source.path = config/overlays/foo, this would update the kustomization in config/base
# if the Application spec.source.path = config/overlays/foo, this would update the kustomization in config/base
```

...or absolute with respect to the repository:
Expand All @@ -374,7 +376,7 @@ You may also specify which helmvalues to update with either a path relative to t

```yaml
argocd-image-updater.argoproj.io/write-back-target: "helmvalues:../../values.yaml"
# if the Application spec.source.path = config/overlays/foo, this would update the helmvalues in config/base
# if the Application spec.source.path = config/overlays/foo, this would update the helmvalues in config/base
```

...or absolute with respect to the repository:
Expand Down

0 comments on commit f1976ce

Please sign in to comment.