diff --git a/cmd/podman/restore.go b/cmd/podman/restore.go index 9c77d4a5e3..4d715ad4f8 100644 --- a/cmd/podman/restore.go +++ b/cmd/podman/restore.go @@ -79,5 +79,14 @@ func restoreCmd(c *cliconfig.RestoreValues, cmd *cobra.Command) error { if (c.Import != "") && (c.All || c.Latest) { return errors.Errorf("Cannot use --import and --all or --latest at the same time") } + + argLen := len(c.InputArgs) + if (c.All || c.Latest) && argLen > 0 { + return errors.Errorf("no arguments are needed with --all or --latest") + } + if argLen < 1 && !c.All && !c.Latest && c.Import == "" { + return errors.Errorf("you must provide at least one name or id") + } + return runtime.Restore(getContext(), c, options) } diff --git a/test/system/005-info.bats b/test/system/005-info.bats index 47c7a52fcc..0068e35a92 100644 --- a/test/system/005-info.bats +++ b/test/system/005-info.bats @@ -14,7 +14,7 @@ Distribution: OCIRuntime:\\\s\\\+package: os: rootless: -insecure registries: +registries: store: GraphDriverName: GraphRoot: @@ -37,9 +37,7 @@ RunRoot: tests=" host.BuildahVersion | [0-9.] -host.Conmon.package | $expr_nvr host.Conmon.path | $expr_path -host.OCIRuntime.package | $expr_nvr host.OCIRuntime.path | $expr_path store.ConfigFile | $expr_path store.GraphDriverName | [a-z0-9]\\\+\\\$ diff --git a/test/system/120-load.bats b/test/system/120-load.bats index dedfe61720..f2dedb73f3 100644 --- a/test/system/120-load.bats +++ b/test/system/120-load.bats @@ -87,6 +87,10 @@ verify_iid_and_name() { @test "podman load - will not read from tty" { + if [ ! -t 0 ]; then + skip "STDIN is not a tty" + fi + run_podman 125 load is "$output" \ "Error: cannot read from terminal. Use command-line redirection" \