diff options
author | Clark Laughlin <clark.laughlin@linaro.org> | 2015-11-02 16:40:05 -0500 |
---|---|---|
committer | Clark Laughlin <clark.laughlin@linaro.org> | 2015-11-02 16:40:05 -0500 |
commit | cafbfa6e1c6ebd5dbaf0d38b0bbf1fbf69f1c736 (patch) | |
tree | 278cf674da47e4c050a471c7e16476e84c7570d7 | |
parent | f2535868287104313f59e3ce0de5915645198b8a (diff) |
server.go: fix for processing of tag data for quay.io registry
-rw-r--r-- | registry-browser/server.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/registry-browser/server.go b/registry-browser/server.go index 8f0d68f..e01740b 100644 --- a/registry-browser/server.go +++ b/registry-browser/server.go @@ -95,23 +95,29 @@ func Handle_Quay_AllRepos(w http.ResponseWriter, r *http.Request) { log.Fatal(err) } - tags := struct{ + tagsSourceData := struct{ HasAdditional bool `json:"has_additional"` Page int `json:"page"` - Tags []string `json:"tags"` + Tags []map[string]interface{} `json:"tags"` }{} - err = json.Unmarshal([]byte(content), &tags) + err = json.Unmarshal([]byte(content), &tagsSourceData) if err != nil { log.Fatal(err) } + tags := []string{} + for _, each := range tagsSourceData.Tags { + tagName := each["name"].(string) + tags = append(tags, tagName) + } + // // add to the response // responseData.Repositories = append(responseData.Repositories, - repositoryEntry{ ns, name, desc, link, tags.Tags }) + repositoryEntry{ ns, name, desc, link, tags }) } enc := json.NewEncoder(w) |