add some more tests and debug logs

This commit is contained in:
Simon Aronsson 2020-11-21 21:34:56 +01:00
parent 2b68874087
commit 0c704ce02b
No known key found for this signature in database
GPG key ID: 8DA57A5FD341605B
9 changed files with 727 additions and 39 deletions

View file

@ -12,7 +12,6 @@ import (
// BuildManifestURL from raw image data
func BuildManifestURL(image apiTypes.ImageInspect) (string, error) {
img, tag := extractImageAndTag(image)
hostName, err := ref.ParseNormalizedNamed(img)
if err != nil {
return "", err
@ -23,6 +22,9 @@ func BuildManifestURL(image apiTypes.ImageInspect) (string, error) {
return "", err
}
img = strings.TrimPrefix(img, fmt.Sprintf("%s/", host))
if !strings.Contains(img, "/") {
img = "library/" + img
}
url := url2.URL{
Scheme: "https",
Host: host,