aboutsummaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-05-04 14:52:19 -0400
committerGitHub <noreply@github.com>2022-05-04 14:52:19 -0400
commitbdaac4b2b6573d0954c58da9968536017160b1ed (patch)
treeb645cdf0fab35e8e31b729eac58c8e3c57a64daa /pkg/api
parent0e2a80a62258d242cad53cd0bc29a9598a8514ad (diff)
parent5fa6f686dbeaf04e1df8a888b9458c3d7f42eee8 (diff)
downloadpodman-bdaac4b2b6573d0954c58da9968536017160b1ed.tar.gz
podman-bdaac4b2b6573d0954c58da9968536017160b1ed.tar.bz2
podman-bdaac4b2b6573d0954c58da9968536017160b1ed.zip
Merge pull request #14037 from rhatdan/remoteuri
Report correct RemoteURI
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/server/server.go21
1 files changed, 1 insertions, 20 deletions
diff --git a/pkg/api/server/server.go b/pkg/api/server/server.go
index a906a01f1..7f5537fb4 100644
--- a/pkg/api/server/server.go
+++ b/pkg/api/server/server.go
@@ -20,7 +20,6 @@ import (
"github.com/containers/podman/v4/pkg/api/server/idle"
"github.com/containers/podman/v4/pkg/api/types"
"github.com/containers/podman/v4/pkg/domain/entities"
- "github.com/coreos/go-systemd/v22/activation"
"github.com/coreos/go-systemd/v22/daemon"
"github.com/gorilla/mux"
"github.com/gorilla/schema"
@@ -65,25 +64,7 @@ func NewServerWithSettings(runtime *libpod.Runtime, listener net.Listener, opts
}
func newServer(runtime *libpod.Runtime, listener net.Listener, opts entities.ServiceOptions) (*APIServer, error) {
- // If listener not provided try socket activation protocol
- if listener == nil {
- if _, found := os.LookupEnv("LISTEN_PID"); !found {
- return nil, fmt.Errorf("no service listener provided and socket activation protocol is not active")
- }
-
- listeners, err := activation.Listeners()
- if err != nil {
- return nil, fmt.Errorf("cannot retrieve file descriptors from systemd: %w", err)
- }
- if len(listeners) != 1 {
- return nil, fmt.Errorf("wrong number of file descriptors for socket activation protocol (%d != 1)", len(listeners))
- }
- listener = listeners[0]
- // note that activation.Listeners() return nil when it cannot listen on the fd (i.e. udp connection)
- if listener == nil {
- return nil, fmt.Errorf("unexpected fd received from systemd: cannot listen on it")
- }
- }
+ logrus.Infof("API service listening on %q. URI: %q", listener.Addr(), runtime.RemoteURI())
if opts.CorsHeaders == "" {
logrus.Debug("CORS Headers were not set")
} else {