From e2b288318b15fa3e3cdc38c3dc7e66774920be8d Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Fri, 18 Mar 2022 10:26:18 -0700 Subject: [PATCH] fix: Use `latest` image tag when version is `untagged`. Fixes #8188 (#8191) Signed-off-by: Alex Collins --- version.go | 9 +++++++++ workflow/controller/config.go | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/version.go b/version.go index 140c16a69324..651364d6577b 100644 --- a/version.go +++ b/version.go @@ -17,6 +17,15 @@ var ( gitTreeState = "" // determined from `git status --porcelain`. either 'clean' or 'dirty' ) +// ImageTag return the image tag. +// GetVersion().Version adulterates the version making it useless as the image tag. +func ImageTag() string { + if version != "untagged" { + return version + } + return "latest" +} + // GetVersion returns the version information func GetVersion() wfv1.Version { var versionStr string diff --git a/workflow/controller/config.go b/workflow/controller/config.go index 454eaaed3556..6cb73b1d36cf 100644 --- a/workflow/controller/config.go +++ b/workflow/controller/config.go @@ -102,7 +102,7 @@ func (wfc *WorkflowController) executorImage() string { if v := wfc.Config.GetExecutor().Image; v != "" { return v } - return fmt.Sprintf("quay.io/argoproj/argoexec:" + argo.GetVersion().Version) + return fmt.Sprintf("quay.io/argoproj/argoexec:" + argo.ImageTag()) } // executorImagePullPolicy returns the imagePullPolicy to use for the workflow executor