Fix handler and systemd activation errors

On panic from handler: log warning and stack trace, report
InternalServerError to client

When using `podman system service` make determining the listening endpoint deterministic.

  // When determining _*THE*_ listening endpoint --
  // 1) User input wins always
  // 2) systemd socket activation
  // 3) rootless honors XDG_RUNTIME_DIR
  // 4) if varlink -- adapter.DefaultVarlinkAddress
  // 5) lastly adapter.DefaultAPIAddress

Fixes #5150
Fixes #5151

Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
Jhon Honce
2020-02-10 14:24:10 -07:00
parent 640b11f002
commit c0c44ae8a3
24 changed files with 358 additions and 233 deletions

View File

@@ -5,7 +5,7 @@ import (
"github.com/gorilla/mux"
)
func (s *APIServer) RegisterDistributionHandlers(r *mux.Router) error {
func (s *APIServer) registerDistributionHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/distribution/{name}/json"), handlers.UnsupportedHandler)
return nil
}