From c0a986b43b5457b565438c1211125ae8c36b76ae Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 25 May 2024 16:32:37 +0200 Subject: [PATCH] build: loadInputs: remove redundant check for hasTag hasTag was always true as it was set to "true" when missing, in which case the default (`:latest`) tag was applied; localPath, tag, hasTag := strings.Cut(localPath, ":") if !hasTag { tag = "latest" hasTag = true } Signed-off-by: Sebastiaan van Stijn --- build/opt.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/build/opt.go b/build/opt.go index 5d05e25a76f..99da75f5696 100644 --- a/build/opt.go +++ b/build/opt.go @@ -500,7 +500,6 @@ func loadInputs(ctx context.Context, d *driver.DriverHandle, inp Inputs, addVCSL localPath, tag, hasTag := strings.Cut(localPath, ":") if !hasTag { tag = "latest" - hasTag = true } idx := ociindex.NewStoreIndex(localPath) if !hasDigest { @@ -543,10 +542,7 @@ func loadInputs(ctx context.Context, d *driver.DriverHandle, inp Inputs, addVCSL } target.OCIStores[storeName] = store - layout := "oci-layout://" + storeName - if hasTag { - layout += ":" + tag - } + layout := "oci-layout://" + storeName + ":" + tag if hasDigest { layout += "@" + dig }