From b75d85ea79a7ba5954178f5c3d00d1b7b3e73972 Mon Sep 17 00:00:00 2001 From: Tempris Admin Date: Thu, 18 Jun 2026 03:49:36 +0700 Subject: [PATCH] fix: guard against empty Build.Image in ImageNameWithDigest ImageNameWithDigest did not validate that Build.Image is non-empty. When called with a non-empty digest but empty image name, it produced the malformed OCI reference @sha256:... (missing image name prefix), causing confusing downstream parse errors in name.ParseReference. Added early return for empty image. Fixes #3902 --- pkg/functions/function.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/functions/function.go b/pkg/functions/function.go index 86c96321ba..cc17a6f273 100644 --- a/pkg/functions/function.go +++ b/pkg/functions/function.go @@ -862,6 +862,9 @@ func (f Function) ImageNameWithDigest(newDigest string) string { return f.Build.Image } image := f.Build.Image + if image == "" { + return "" + } // overwrite current digest shaIndex := strings.Index(image, "@sha256:")