mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-22 03:37:45 +08:00
Merge pull request #2477 from thaJeztah/remove_redundant_checks
build: loadInputs: remove redundant checks for hasTag, hasDigest
This commit is contained in:
commit
55c86543ca
11
build/opt.go
11
build/opt.go
@ -500,7 +500,6 @@ func loadInputs(ctx context.Context, d *driver.DriverHandle, inp Inputs, addVCSL
|
|||||||
localPath, tag, hasTag := strings.Cut(localPath, ":")
|
localPath, tag, hasTag := strings.Cut(localPath, ":")
|
||||||
if !hasTag {
|
if !hasTag {
|
||||||
tag = "latest"
|
tag = "latest"
|
||||||
hasTag = true
|
|
||||||
}
|
}
|
||||||
idx := ociindex.NewStoreIndex(localPath)
|
idx := ociindex.NewStoreIndex(localPath)
|
||||||
if !hasDigest {
|
if !hasDigest {
|
||||||
@ -543,15 +542,7 @@ func loadInputs(ctx context.Context, d *driver.DriverHandle, inp Inputs, addVCSL
|
|||||||
}
|
}
|
||||||
target.OCIStores[storeName] = store
|
target.OCIStores[storeName] = store
|
||||||
|
|
||||||
layout := "oci-layout://" + storeName
|
target.FrontendAttrs["context:"+k] = "oci-layout://" + storeName + ":" + tag + "@" + dig
|
||||||
if hasTag {
|
|
||||||
layout += ":" + tag
|
|
||||||
}
|
|
||||||
if hasDigest {
|
|
||||||
layout += "@" + dig
|
|
||||||
}
|
|
||||||
|
|
||||||
target.FrontendAttrs["context:"+k] = layout
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
st, err := os.Stat(v.Path)
|
st, err := os.Stat(v.Path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user