Skip to content

Commit

Permalink
build: loadInputs: remove redundant check for hasTag
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
thaJeztah committed May 25, 2024
1 parent 37c4ff0 commit c0a986b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 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,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
}
Expand Down

0 comments on commit c0a986b

Please sign in to comment.