From 954a250c6d9862735ec069a780fb7a1585b6b3d3 Mon Sep 17 00:00:00 2001 From: Andrew Cholakian Date: Mon, 16 Aug 2021 15:11:25 -0500 Subject: [PATCH] [elastic-agent] Use -complete in docker image name, not tag (#27399) Previously `complete` images were named `elastic-agent:8.0.0-complete`, this changes them to `elastic-agent-complete:8.0.0` to be compatible with our release process. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- dev-tools/mage/dockerbuilder.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dev-tools/mage/dockerbuilder.go b/dev-tools/mage/dockerbuilder.go index 986209609d2..0fba00b4e26 100644 --- a/dev-tools/mage/dockerbuilder.go +++ b/dev-tools/mage/dockerbuilder.go @@ -195,17 +195,18 @@ func (b *dockerBuilder) expandDockerfile(templatesDir string, data map[string]in } func (b *dockerBuilder) dockerBuild(variant string) (string, error) { - tag := fmt.Sprintf("%s:%s", b.imageName, b.Version) + imageName := b.imageName if variant != "" { - tag = fmt.Sprintf("%s-%s", tag, variant) + imageName = fmt.Sprintf("%s-%s", imageName, variant) } + taggedImageName := fmt.Sprintf("%s:%s", imageName, b.Version) if b.Snapshot { - tag = tag + "-SNAPSHOT" + taggedImageName = taggedImageName + "-SNAPSHOT" } if repository, _ := b.ExtraVars["repository"]; repository != "" { - tag = fmt.Sprintf("%s/%s", repository, tag) + taggedImageName = fmt.Sprintf("%s/%s", repository, taggedImageName) } - return tag, sh.Run("docker", "build", "-t", tag, b.buildDir) + return taggedImageName, sh.Run("docker", "build", "-t", taggedImageName, b.buildDir) } func (b *dockerBuilder) dockerSave(tag string) error {