forked from TrueCloudLab/distribution
Fix list tags
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
e5744a3bad
commit
735a112415
1 changed files with 8 additions and 3 deletions
|
@ -277,6 +277,11 @@ func (r *Session) PutV2ImageManifest(imageName, tagName string, manifestRdr io.R
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type remoteTags struct {
|
||||||
|
name string
|
||||||
|
tags []string
|
||||||
|
}
|
||||||
|
|
||||||
// Given a repository name, returns a json array of string tags
|
// Given a repository name, returns a json array of string tags
|
||||||
func (r *Session) GetV2RemoteTags(imageName string, auth *RequestAuthorization) ([]string, error) {
|
func (r *Session) GetV2RemoteTags(imageName string, auth *RequestAuthorization) ([]string, error) {
|
||||||
routeURL, err := getV2Builder(r.indexEndpoint).BuildTagsURL(imageName)
|
routeURL, err := getV2Builder(r.indexEndpoint).BuildTagsURL(imageName)
|
||||||
|
@ -309,10 +314,10 @@ func (r *Session) GetV2RemoteTags(imageName string, auth *RequestAuthorization)
|
||||||
}
|
}
|
||||||
|
|
||||||
decoder := json.NewDecoder(res.Body)
|
decoder := json.NewDecoder(res.Body)
|
||||||
var tags []string
|
var remote remoteTags
|
||||||
err = decoder.Decode(&tags)
|
err = decoder.Decode(&remote)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error while decoding the http response: %s", err)
|
return nil, fmt.Errorf("Error while decoding the http response: %s", err)
|
||||||
}
|
}
|
||||||
return tags, nil
|
return remote.tags, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue