cmd, build: remove redundant squash processing logic

Same block contains similar lines above this is not needed as this looks
redundant.

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
Aditya R
2022-05-23 15:25:34 +05:30
parent acdfb4d14f
commit b730e7328e

View File

@ -442,22 +442,6 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
return nil, err return nil, err
} }
// `buildah bud --layers=false` acts like `docker build --squash` does.
// That is all of the new layers created during the build process are
// condensed into one, any layers present prior to this build are retained
// without condensing. `buildah bud --squash` squashes both new and old
// layers down into one. Translate Podman commands into Buildah.
// Squash invoked, retain old layers, squash new layers into one.
if c.Flags().Changed("squash") && flags.Squash {
flags.Squash = false
flags.Layers = false
}
// Squash-all invoked, squash both new and old layers into one.
if c.Flags().Changed("squash-all") {
flags.Squash = true
flags.Layers = false
}
compression := buildahDefine.Gzip compression := buildahDefine.Gzip
if flags.DisableCompression { if flags.DisableCompression {
compression = buildahDefine.Uncompressed compression = buildahDefine.Uncompressed