summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-23 13:00:10 -0500
committerGitHub <noreply@github.com>2020-02-23 13:00:10 -0500
commit18dcb84d641f4e8ae7fa31fa446d9461e0c915ab (patch)
tree2eded21423db3b433d873e9cbcc614e8a7931cef /pkg
parenteef9875a6133d4cbf4e6f63771dd86045f071f7d (diff)
parentfab5b35b2ace79564ce182979887f5a062a0e55f (diff)
downloadpodman-18dcb84d641f4e8ae7fa31fa446d9461e0c915ab.tar.gz
podman-18dcb84d641f4e8ae7fa31fa446d9461e0c915ab.tar.bz2
podman-18dcb84d641f4e8ae7fa31fa446d9461e0c915ab.zip
Merge pull request #4889 from baude/portsearch
fix port list by container with port
Diffstat (limited to 'pkg')
-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..78057e3f9 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()
}