diff options
Diffstat (limited to 'cmd/podman/common/create_opts.go')
-rw-r--r-- | cmd/podman/common/create_opts.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index 430354ee9..78611371d 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -7,12 +7,12 @@ import ( "strconv" "strings" - "github.com/containers/podman/v2/cmd/podman/registry" - "github.com/containers/podman/v2/pkg/api/handlers" - "github.com/containers/podman/v2/pkg/cgroups" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/pkg/rootless" - "github.com/containers/podman/v2/pkg/specgen" + "github.com/containers/podman/v3/cmd/podman/registry" + "github.com/containers/podman/v3/pkg/api/handlers" + "github.com/containers/podman/v3/pkg/cgroups" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/rootless" + "github.com/containers/podman/v3/pkg/specgen" ) type ContainerCLIOpts struct { @@ -223,7 +223,11 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup // publish for port, pbs := range cc.HostConfig.PortBindings { for _, pb := range pbs { - hostport, err := strconv.Atoi(pb.HostPort) + var hostport int + var err error + if pb.HostPort != "" { + hostport, err = strconv.Atoi(pb.HostPort) + } if err != nil { return nil, nil, err } |