summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-04-21 12:55:31 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-04-21 13:32:20 +0200
commit13c6fd067cab2fd21f96837c6b6105ebb740fd1d (patch)
tree7db35e02f667251f6fa55ce7734610306f61a287 /pkg
parent02ab86a68aa3c510dc8be8aefbd1029efb657438 (diff)
downloadpodman-13c6fd067cab2fd21f96837c6b6105ebb740fd1d.tar.gz
podman-13c6fd067cab2fd21f96837c6b6105ebb740fd1d.tar.bz2
podman-13c6fd067cab2fd21f96837c6b6105ebb740fd1d.zip
system service: remove unnecessary pointer to listner
Since the listener is already an interface there is no reason to use a extra pointer for it. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/server/server.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/api/server/server.go b/pkg/api/server/server.go
index 73740a6f9..9344101ce 100644
--- a/pkg/api/server/server.go
+++ b/pkg/api/server/server.go
@@ -60,11 +60,11 @@ func NewServer(runtime *libpod.Runtime) (*APIServer, error) {
}
// NewServerWithSettings will create and configure a new API server using provided settings
-func NewServerWithSettings(runtime *libpod.Runtime, listener *net.Listener, opts entities.ServiceOptions) (*APIServer, error) {
+func NewServerWithSettings(runtime *libpod.Runtime, listener net.Listener, opts entities.ServiceOptions) (*APIServer, error) {
return newServer(runtime, listener, opts)
}
-func newServer(runtime *libpod.Runtime, listener *net.Listener, opts entities.ServiceOptions) (*APIServer, error) {
+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 {
@@ -78,7 +78,7 @@ func newServer(runtime *libpod.Runtime, listener *net.Listener, opts entities.Se
if len(listeners) != 1 {
return nil, fmt.Errorf("wrong number of file descriptors for socket activation protocol (%d != 1)", len(listeners))
}
- listener = &listeners[0]
+ listener = listeners[0]
}
if opts.CorsHeaders == "" {
logrus.Debug("CORS Headers were not set")
@@ -86,7 +86,7 @@ func newServer(runtime *libpod.Runtime, listener *net.Listener, opts entities.Se
logrus.Debugf("CORS Headers were set to %q", opts.CorsHeaders)
}
- logrus.Infof("API service listening on %q", (*listener).Addr())
+ logrus.Infof("API service listening on %q", listener.Addr())
router := mux.NewRouter().UseEncodedPath()
tracker := idle.NewTracker(opts.Timeout)
@@ -101,7 +101,7 @@ func newServer(runtime *libpod.Runtime, listener *net.Listener, opts entities.Se
IdleTimeout: opts.Timeout * 2,
},
CorsHeaders: opts.CorsHeaders,
- Listener: *listener,
+ Listener: listener,
PProfAddr: opts.PProfAddr,
idleTracker: tracker,
}