summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-20 10:42:00 -0400
committerGitHub <noreply@github.com>2020-04-20 10:42:00 -0400
commite5e625b2a6481dd49d1d6303df1157c8a51dd7c2 (patch)
treeaf3212ad2ddcf805ff2f38a9e63d06e6c7472137 /pkg/domain
parentbd711358525b09ebc4cb49094a674700b87f7ec0 (diff)
parent4e0326241b35d2549fdba5666f343c31279e18e4 (diff)
downloadpodman-e5e625b2a6481dd49d1d6303df1157c8a51dd7c2.tar.gz
podman-e5e625b2a6481dd49d1d6303df1157c8a51dd7c2.tar.bz2
podman-e5e625b2a6481dd49d1d6303df1157c8a51dd7c2.zip
Merge pull request #5872 from jwhonce/wip/options
V2 Fix support for tcp://[::]<port> connections
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/infra/abi/system.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go
index 67593b2dd..078f5404d 100644
--- a/pkg/domain/infra/abi/system.go
+++ b/pkg/domain/infra/abi/system.go
@@ -35,7 +35,7 @@ func (ic *ContainerEngine) Info(ctx context.Context) (*define.Info, error) {
func (ic *ContainerEngine) RestService(_ context.Context, opts entities.ServiceOptions) error {
var (
- listener net.Listener
+ listener *net.Listener
err error
)
@@ -45,13 +45,14 @@ func (ic *ContainerEngine) RestService(_ context.Context, opts entities.ServiceO
return errors.Errorf("%s is an invalid socket destination", opts.URI)
}
address := strings.Join(fields[1:], ":")
- listener, err = net.Listen(fields[0], address)
+ l, err := net.Listen(fields[0], address)
if err != nil {
return errors.Wrapf(err, "unable to create socket %s", opts.URI)
}
+ listener = &l
}
- server, err := api.NewServerWithSettings(ic.Libpod, opts.Timeout, &listener)
+ server, err := api.NewServerWithSettings(ic.Libpod, opts.Timeout, listener)
if err != nil {
return err
}
@@ -62,7 +63,9 @@ func (ic *ContainerEngine) RestService(_ context.Context, opts entities.ServiceO
}()
err = server.Serve()
- _ = listener.Close()
+ if listener != nil {
+ _ = (*listener).Close()
+ }
return err
}