From f0e2e3786ffab47bad266594df51bc7da41e5bdf Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Sat, 14 Sep 2019 13:57:50 +0200 Subject: [PATCH] weldr: use source.Id instead of .Name for keys --- weldr/api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weldr/api.go b/weldr/api.go index 139527d6b..ad78b7623 100644 --- a/weldr/api.go +++ b/weldr/api.go @@ -133,7 +133,7 @@ func (api *API) sourceListHandler(writer http.ResponseWriter, request *http.Requ } json.NewEncoder(writer).Encode(reply{ - Sources: []string{api.repo.Name}, + Sources: []string{api.repo.Id}, }) } @@ -155,7 +155,7 @@ func (api *API) sourceInfoHandler(writer http.ResponseWriter, request *http.Requ // we only have one repository names := strings.Split(params.ByName("sources"), ",") - if names[0] != api.repo.Name && names[0] != "*" { + if names[0] != api.repo.Id && names[0] != "*" { statusResponseError(writer, http.StatusBadRequest, "repository not found: "+names[0]) return } @@ -180,7 +180,7 @@ func (api *API) sourceInfoHandler(writer http.ResponseWriter, request *http.Requ } json.NewEncoder(writer).Encode(reply{ - Sources: map[string]sourceConfig{cfg.Name: cfg}, + Sources: map[string]sourceConfig{cfg.Id: cfg}, }) }