Specify format to buildah before commit

If user specifies commit --format, we were not setting it before
commit, this caused warning messages that made no sense to be
printed that made no sense.

Fixes: https://github.com/containers/podman/issues/17773

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2023-04-14 07:49:13 -04:00
parent e74a4086ec
commit 81621ce8af
2 changed files with 14 additions and 0 deletions

View File

@ -68,6 +68,7 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai
PreferredManifestType: options.PreferredManifestType,
}
importBuilder, err := buildah.ImportBuilder(ctx, c.runtime.store, builderOptions)
importBuilder.Format = options.PreferredManifestType
if err != nil {
return nil, err
}