summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-03-18 06:14:53 -0700
committerGitHub <noreply@github.com>2019-03-18 06:14:53 -0700
commitcd5f4786ce57186fc6dd7a7e9c4fc61ed99a8d26 (patch)
tree0e295d210c718159788333c0611ac50e6fe6c7b8 /cmd
parent122d00f67fb8b47ec29f922f9cc32af13123e8f2 (diff)
parent7fee7d833cda2373977993364eac349787ee7a6d (diff)
downloadpodman-cd5f4786ce57186fc6dd7a7e9c4fc61ed99a8d26.tar.gz
podman-cd5f4786ce57186fc6dd7a7e9c4fc61ed99a8d26.tar.bz2
podman-cd5f4786ce57186fc6dd7a7e9c4fc61ed99a8d26.zip
Merge pull request #2684 from giuseppe/fix-crash-pod-inspect
pod: fix segfault when there are no arguments to inspect
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/pod_inspect.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/pod_inspect.go b/cmd/podman/pod_inspect.go
index 79ffe2e6f..46ac30c2a 100644
--- a/cmd/podman/pod_inspect.go
+++ b/cmd/podman/pod_inspect.go
@@ -44,6 +44,11 @@ func podInspectCmd(c *cliconfig.PodInspectValues) error {
pod *adapter.Pod
)
args := c.InputArgs
+
+ if len(args) < 1 && !c.Latest {
+ return errors.Errorf("you must provide the name or id of a pod")
+ }
+
runtime, err := adapter.GetRuntime(&c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "could not get runtime")