Skip to content

Commit

Permalink
Merge pull request docker#2477 from thaJeztah/remove_redundant_checks
Browse files Browse the repository at this point in the history
build: loadInputs: remove redundant checks for hasTag, hasDigest
  • Loading branch information
crazy-max authored May 27, 2024
2 parents f98ef00 + 17c0a37 commit 55c8654
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions build/opt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -543,15 +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
}
if hasDigest {
layout += "@" + dig
}

target.FrontendAttrs["context:"+k] = layout
target.FrontendAttrs["context:"+k] = "oci-layout://" + storeName + ":" + tag + "@" + dig
continue
}
st, err := os.Stat(v.Path)
Expand Down

0 comments on commit 55c8654

Please sign in to comment.