Deal with case of no service request arguments
It's possible to send a request to ListServicesWithOptions that
doesn't specify the services of interest.
@@ -144,6 +144,7 @@ func (s HTTPServer) ListServicesWithOptions(w http.ResponseWriter, r *http.Reque
var opts v11.ListServicesOptions
opts.Namespace = r.URL.Query().Get("namespace")
services := r.URL.Query().Get("services")
+ if services != "" {
for _, svc := range strings.Split(services, ",") {
id, err := flux.ParseResourceID(svc)
if err != nil {
@@ -152,6 +153,7 @@ func (s HTTPServer) ListServicesWithOptions(w http.ResponseWriter, r *http.Reque
}
opts.Services = append(opts.Services, id)
}
+ }
res, err := s.server.ListServicesWithOptions(r.Context(), opts)
if err != nil {
