Skip to content

Commit

Permalink
fix(kustomize): allow using build env in images (argoproj#13745)
Browse files Browse the repository at this point in the history
This allows substituting the target revision using
image:${ARGOCD_APP_REVISION}

Signed-off-by: Robin Gloster <mail@glob.in>
  • Loading branch information
globin authored and xiaowu.zhu committed Aug 9, 2023
1 parent ab21ef7 commit ba1808c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util/kustomize/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ func (k *kustomize) Build(opts *v1alpha1.ApplicationSourceKustomize, kustomizeOp
// set image node:8.15.0 mysql=mariadb alpine@sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3
args := []string{"edit", "set", "image"}
for _, image := range opts.Images {
args = append(args, string(image))
// this allows using ${ARGOCD_APP_REVISION}
envSubstitutedImage := envVars.Envsubst(string(image))
args = append(args, envSubstitutedImage)
}
cmd := exec.Command(k.getBinaryPath(), args...)
cmd.Dir = k.path
Expand Down

0 comments on commit ba1808c

Please sign in to comment.