grim/tagpull

Rename the repo to tagpull
draft
2020-07-05, Gary Kramlich
4a2ab904ba01
Rename the repo to tagpull
package main
import (
"strings"
"github.com/heroku/docker-registry-client/registry"
)
func registryGetDigest(repository, tag string) (string, error) {
reg, err := registry.New("https://index.docker.io", "", "")
if err != nil {
return "", err
}
// make sure the repository doesn't have a tag
repository = strings.SplitN(repository, ":", 2)[0]
// disable the logger on the registry
reg.Logf = func(format string, args ...interface{}) {}
manifest, err := reg.ManifestV2(repository, tag)
if err != nil {
return "", err
}
return manifest.Config.Digest.String(), nil
}