From 221e9624e3a7a7a9b81ffda9930657352080e32d Mon Sep 17 00:00:00 2001 From: Meaglith Ma Date: Thu, 12 Mar 2015 03:45:01 +0800 Subject: [PATCH 1/2] Fix decode tags value error when call get /v2//tags/list in registry api v2. Signed-off-by: Meaglith Ma --- registry/session_v2.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/registry/session_v2.go b/registry/session_v2.go index 833abeed6f..ed8ce061e3 100644 --- a/registry/session_v2.go +++ b/registry/session_v2.go @@ -352,8 +352,8 @@ func (r *Session) PutV2ImageManifest(ep *Endpoint, imageName, tagName string, si } type remoteTags struct { - name string - tags []string + Name string + Tags []string } // Given a repository name, returns a json array of string tags @@ -393,5 +393,5 @@ func (r *Session) GetV2RemoteTags(ep *Endpoint, imageName string, auth *RequestA if err != nil { return nil, fmt.Errorf("Error while decoding the http response: %s", err) } - return remote.tags, nil + return remote.Tags, nil } From 4925d98d1f638e9439e19b6c89c608a64a281a39 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Mon, 23 Mar 2015 14:23:47 -0700 Subject: [PATCH 2/2] Add struct tags on v2 remote tags struct Signed-off-by: Derek McGowan (github: dmcgowan) --- registry/session_v2.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/session_v2.go b/registry/session_v2.go index ed8ce061e3..22f39317be 100644 --- a/registry/session_v2.go +++ b/registry/session_v2.go @@ -352,8 +352,8 @@ func (r *Session) PutV2ImageManifest(ep *Endpoint, imageName, tagName string, si } type remoteTags struct { - Name string - Tags []string + Name string `json:"name"` + Tags []string `json:"tags"` } // Given a repository name, returns a json array of string tags