Merge pull request #2684 from giuseppe/fix-crash-pod-inspect

pod: fix segfault when there are no arguments to inspect
This commit is contained in:
OpenShift Merge Robot
2019-03-18 06:14:53 -07:00
committed by GitHub

View File

@ -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")