mirror of
https://github.com/containers/podman.git
synced 2025-06-19 00:06:43 +08:00
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:
@ -44,6 +44,11 @@ func podInspectCmd(c *cliconfig.PodInspectValues) error {
|
|||||||
pod *adapter.Pod
|
pod *adapter.Pod
|
||||||
)
|
)
|
||||||
args := c.InputArgs
|
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)
|
runtime, err := adapter.GetRuntime(&c.PodmanCommand)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "could not get runtime")
|
return errors.Wrapf(err, "could not get runtime")
|
||||||
|
Reference in New Issue
Block a user