Fix list tags

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan 2015-01-07 15:55:29 -08:00
parent e5744a3bad
commit 735a112415

View file

@ -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
} }