summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2020-01-16 13:38:59 -0600
committerBrent Baude <bbaude@redhat.com>2020-02-23 11:03:56 -0600
commit5a1609b9cf89940c570e488a2ea0f481b22ed424 (patch)
tree90c1bd70f16452ddc50059665b6ee28c7539d0bc /pkg/adapter/containers.go
parent9fd01e19458bd8c8281663bdb504f02aa3a92e3b (diff)
downloadpodman-5a1609b9cf89940c570e488a2ea0f481b22ed424.tar.gz
podman-5a1609b9cf89940c570e488a2ea0f481b22ed424.tar.bz2
podman-5a1609b9cf89940c570e488a2ea0f481b22ed424.zip
fix port list by container with port
code was erronously misinterpretting the port as a containername. Fixes: #1791832 Signed-off-by: baude <bbaude@redhat.com> Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/adapter/containers.go')
-rw-r--r--pkg/adapter/containers.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index ab4255f89..2b9430d40 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -1116,7 +1116,11 @@ func (r *LocalRuntime) Port(c *cliconfig.PortValues) ([]*Container, error) {
)
if !c.All {
- containers, err = shortcuts.GetContainersByContext(false, c.Latest, c.InputArgs, r.Runtime)
+ names := []string{}
+ if len(c.InputArgs) > 1 {
+ names = []string{c.InputArgs[0]}
+ }
+ containers, err = shortcuts.GetContainersByContext(false, c.Latest, names, r.Runtime)
} else {
containers, err = r.Runtime.GetRunningContainers()
}