From 1629623c92e16ae27b12d7623a7fa7bea4c0b1e0 Mon Sep 17 00:00:00 2001 From: Haven Xia Date: Tue, 1 Sep 2026 23:57:43 -0700 Subject: [PATCH] ate-setup: take the prebuilt version from the tag without its digest With --image-repo the image tag becomes the substrate version, which names the atelet DaemonSet and the node label. A tag written with its digest, v1@sha256:..., is a valid image reference but not a valid label value, so the install failed at the atelet step unless VERSION was also set. The version is now the tag alone; the digest still pins the image. --- cmd/ate-setup/internal/steps/version.go | 4 +++- cmd/ate-setup/internal/steps/version_test.go | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/ate-setup/internal/steps/version.go b/cmd/ate-setup/internal/steps/version.go index 00ebbaee28..9e0413f30c 100644 --- a/cmd/ate-setup/internal/steps/version.go +++ b/cmd/ate-setup/internal/steps/version.go @@ -48,7 +48,9 @@ func (e *Env) SubstrateVersion() (version, suffix string, err error) { if e.Cfg.Images.IsPrebuilt() { raw = os.Getenv("VERSION") if raw == "" { - raw = e.Cfg.Images.Tag + // The tag may carry its digest (v1@sha256:...); the version + // is the tag alone. + raw, _, _ = strings.Cut(e.Cfg.Images.Tag, "@") } } else { // ko.BuildVersion consults VERSION itself before `git describe`. diff --git a/cmd/ate-setup/internal/steps/version_test.go b/cmd/ate-setup/internal/steps/version_test.go index 3391eb1764..d0772c1095 100644 --- a/cmd/ate-setup/internal/steps/version_test.go +++ b/cmd/ate-setup/internal/steps/version_test.go @@ -37,6 +37,11 @@ func TestSubstrateVersionPrebuilt(t *testing.T) { source: images.Source{Repo: "example.com/substrate", Tag: "v0.0.0-503-4b3423c0"}, want: "v0.0.0-503-4b3423c0", wantSuffix: "v0-0-0-503-4b3423c0", + }, { + name: "a tag carrying its digest is the version without it", + source: images.Source{Repo: "example.com/substrate", Tag: "v0.0.0@sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}, + want: "v0.0.0", + wantSuffix: "v0-0-0", }, { name: "built from source falls back to git", source: images.Source{},