mirror of
https://github.com/containers/podman.git
synced 2025-06-17 06:57: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
|
||||
)
|
||||
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")
|
||||
|
Reference in New Issue
Block a user