Skip to content
Snippets Groups Projects
Unverified Commit d8ac9f88 authored by Bob Callaway's avatar Bob Callaway Committed by GitHub
Browse files

insert sha256: prefix if not provided (#381)

parent 07c8e8fd
No related branches found
No related tags found
No related merge requests found
......@@ -114,9 +114,12 @@ var searchCmd = &cobra.Command{
artifactStr := viper.GetString("artifact")
sha := viper.GetString("sha")
if sha != "" {
params.Query.Hash = sha
var prefix string
if !strings.HasPrefix(sha, "sha256:") {
prefix = "sha256:"
}
params.Query.Hash = fmt.Sprintf("%v%v", prefix, sha)
} else if artifactStr != "" {
hasher := sha256.New()
var tee io.Reader
if isURL(artifactStr) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment