Skip to content

Commit 8801e62

Browse files
committed
Make sure the result of /clusters is returned to the user.
1 parent 85f7c94 commit 8801e62

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/apiserver/apiserver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@ func (s *Server) clusters(w http.ResponseWriter, req *http.Request) {
169169
} else if matches := util.FindNamedStringSubmatch(clusterHistoryURL, req.URL.Path); matches != nil {
170170
resp, err = s.controller.ClusterHistory(matches["team"], matches["cluster"])
171171
} else if req.URL.Path == clustersURL {
172-
res := make(map[string][]string)
172+
clusterNamesPerTeam := make(map[string][]string)
173173
for team, clusters := range s.controller.TeamClusterList() {
174174
for _, cluster := range clusters {
175-
res[team] = append(res[team], cluster.Name[len(team)+1:])
175+
clusterNamesPerTeam[team] = append(clusterNamesPerTeam[team], cluster.Name[len(team)+1:])
176176
}
177177
}
178-
err = nil
178+
resp, err = clusterNamesPerTeam, nil
179179
} else {
180180
resp, err = nil, fmt.Errorf("page not found")
181181
}

0 commit comments

Comments
 (0)