diff --git a/pkg/client/operations/check_all_pods_parameters.go b/pkg/client/operations/check_all_pods_parameters.go index a103447..92e99c9 100644 --- a/pkg/client/operations/check_all_pods_parameters.go +++ b/pkg/client/operations/check_all_pods_parameters.go @@ -6,11 +6,10 @@ package operations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/pkg/client/operations/check_service_pods_parameters.go b/pkg/client/operations/check_service_pods_parameters.go index 63f1ea6..007ba8c 100644 --- a/pkg/client/operations/check_service_pods_parameters.go +++ b/pkg/client/operations/check_service_pods_parameters.go @@ -6,11 +6,10 @@ package operations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/pkg/client/operations/healthz_parameters.go b/pkg/client/operations/healthz_parameters.go index 8acc7e7..f0cfde7 100644 --- a/pkg/client/operations/healthz_parameters.go +++ b/pkg/client/operations/healthz_parameters.go @@ -6,11 +6,10 @@ package operations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/pkg/client/operations/ping_parameters.go b/pkg/client/operations/ping_parameters.go index 608ad46..2e93062 100644 --- a/pkg/client/operations/ping_parameters.go +++ b/pkg/client/operations/ping_parameters.go @@ -6,11 +6,10 @@ package operations // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/pkg/restapi/operations/check_all_pods_urlbuilder.go b/pkg/restapi/operations/check_all_pods_urlbuilder.go index cf7e056..f196da4 100644 --- a/pkg/restapi/operations/check_all_pods_urlbuilder.go +++ b/pkg/restapi/operations/check_all_pods_urlbuilder.go @@ -33,14 +33,14 @@ func (o *CheckAllPodsURL) SetBasePath(bp string) { // Build a url path and query string func (o *CheckAllPodsURL) Build() (*url.URL, error) { - var result url.URL + var _result url.URL var _path = "/check_all" _basePath := o._basePath - result.Path = golangswaggerpaths.Join(_basePath, _path) + _result.Path = golangswaggerpaths.Join(_basePath, _path) - return &result, nil + return &_result, nil } // Must is a helper function to panic when the url builder returns an error diff --git a/pkg/restapi/operations/check_service_pods_responses.go b/pkg/restapi/operations/check_service_pods_responses.go index cd9bd39..b4497c4 100644 --- a/pkg/restapi/operations/check_service_pods_responses.go +++ b/pkg/restapi/operations/check_service_pods_responses.go @@ -50,8 +50,12 @@ func (o *CheckServicePodsOK) WriteResponse(rw http.ResponseWriter, producer runt rw.WriteHeader(200) payload := o.Payload + if payload == nil { + // return empty map + payload = models.CheckResults{} + } + if err := producer.Produce(rw, payload); err != nil { panic(err) // let the recovery middleware deal with this } - } diff --git a/pkg/restapi/operations/check_service_pods_urlbuilder.go b/pkg/restapi/operations/check_service_pods_urlbuilder.go index 2206d95..9f61ad4 100644 --- a/pkg/restapi/operations/check_service_pods_urlbuilder.go +++ b/pkg/restapi/operations/check_service_pods_urlbuilder.go @@ -33,14 +33,14 @@ func (o *CheckServicePodsURL) SetBasePath(bp string) { // Build a url path and query string func (o *CheckServicePodsURL) Build() (*url.URL, error) { - var result url.URL + var _result url.URL var _path = "/check" _basePath := o._basePath - result.Path = golangswaggerpaths.Join(_basePath, _path) + _result.Path = golangswaggerpaths.Join(_basePath, _path) - return &result, nil + return &_result, nil } // Must is a helper function to panic when the url builder returns an error diff --git a/pkg/restapi/operations/healthz_urlbuilder.go b/pkg/restapi/operations/healthz_urlbuilder.go index 569c379..2c362fd 100644 --- a/pkg/restapi/operations/healthz_urlbuilder.go +++ b/pkg/restapi/operations/healthz_urlbuilder.go @@ -33,14 +33,14 @@ func (o *HealthzURL) SetBasePath(bp string) { // Build a url path and query string func (o *HealthzURL) Build() (*url.URL, error) { - var result url.URL + var _result url.URL var _path = "/healthz" _basePath := o._basePath - result.Path = golangswaggerpaths.Join(_basePath, _path) + _result.Path = golangswaggerpaths.Join(_basePath, _path) - return &result, nil + return &_result, nil } // Must is a helper function to panic when the url builder returns an error diff --git a/pkg/restapi/operations/ping_urlbuilder.go b/pkg/restapi/operations/ping_urlbuilder.go index 75c17fd..0a77aa2 100644 --- a/pkg/restapi/operations/ping_urlbuilder.go +++ b/pkg/restapi/operations/ping_urlbuilder.go @@ -33,14 +33,14 @@ func (o *PingURL) SetBasePath(bp string) { // Build a url path and query string func (o *PingURL) Build() (*url.URL, error) { - var result url.URL + var _result url.URL var _path = "/ping" _basePath := o._basePath - result.Path = golangswaggerpaths.Join(_basePath, _path) + _result.Path = golangswaggerpaths.Join(_basePath, _path) - return &result, nil + return &_result, nil } // Must is a helper function to panic when the url builder returns an error diff --git a/pkg/restapi/server.go b/pkg/restapi/server.go index abd6668..465426b 100644 --- a/pkg/restapi/server.go +++ b/pkg/restapi/server.go @@ -187,6 +187,7 @@ func (s *Server) Serve() (err error) { configureServer(domainSocket, "unix", string(s.SocketPath)) + servers = append(servers, domainSocket) wg.Add(1) s.Logf("Serving goldpinger at unix://%s", s.SocketPath) go func(l net.Listener) { @@ -196,7 +197,6 @@ func (s *Server) Serve() (err error) { } s.Logf("Stopped serving goldpinger at unix://%s", s.SocketPath) }(s.domainSocketL) - servers = append(servers, domainSocket) } if s.hasScheme(schemeHTTP) { @@ -217,6 +217,7 @@ func (s *Server) Serve() (err error) { configureServer(httpServer, "http", s.httpServerL.Addr().String()) + servers = append(servers, httpServer) wg.Add(1) s.Logf("Serving goldpinger at http://%s", s.httpServerL.Addr()) go func(l net.Listener) { @@ -226,7 +227,6 @@ func (s *Server) Serve() (err error) { } s.Logf("Stopped serving goldpinger at http://%s", l.Addr()) }(s.httpServerL) - servers = append(servers, httpServer) } if s.hasScheme(schemeHTTPS) { @@ -313,6 +313,7 @@ func (s *Server) Serve() (err error) { configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + servers = append(servers, httpsServer) wg.Add(1) s.Logf("Serving goldpinger at https://%s", s.httpsServerL.Addr()) go func(l net.Listener) { @@ -322,7 +323,6 @@ func (s *Server) Serve() (err error) { } s.Logf("Stopped serving goldpinger at https://%s", l.Addr()) }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - servers = append(servers, httpsServer) } wg.Wait()