podman save: update --compress validation

[NO NEW TESTS NEEDED]

Signed-off-by: Hoang Thanh VO <111461555+ht-vo@users.noreply.github.com>
This commit is contained in:
Hoang Thanh VO 2022-08-17 22:49:10 +02:00 committed by Matthew Heon
parent 45672c61d7
commit 0ab8ebd1a8

View file

@ -103,8 +103,8 @@ func save(cmd *cobra.Command, args []string) (finalErr error) {
tags []string
succeeded = false
)
if cmd.Flag("compress").Changed && (saveOpts.Format != define.OCIManifestDir && saveOpts.Format != define.V2s2ManifestDir) {
return errors.New("--compress can only be set when --format is either 'oci-dir' or 'docker-dir'")
if cmd.Flag("compress").Changed && saveOpts.Format != define.V2s2ManifestDir {
return errors.New("--compress can only be set when --format is 'docker-dir'")
}
if len(saveOpts.Output) == 0 {
saveOpts.Quiet = true