Add squash-all, fix squash option in build#4215
Add squash-all, fix squash option in build#4215openshift-merge-robot merged 1 commit intocontainers:masterfrom TomSweeneyRedHat:dev/tsweeney/fixsquash
Conversation
|
I neglected to update the man page and bash completions, will tend to those once I get general consensus for this approach. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TomSweeneyRedHat The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
I've updated with @rhatdan's suggestion to have the squash-all option defined here rather than in buildahcli like the other options. I've also updated bash completions and the man pages. Assuming happy tests and LGTM's, this is good to go. |
|
Testing: |
|
LGTM |
|
☔ The latest upstream changes (presumably #4201) made this pull request unmergeable. Please resolve the merge conflicts. |
Translate the podman build --squash command to podman build --layers=false which has the same functionality as docker build --squash. Add a new option --squash-all which will squash all layers into one. This will be translated to buildah bud --squash for the buildah bud api. Also allow only one option, squash, layers or squash--all to be used per build command. Fixes: containers/buildah#1234 Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
|
Somethings wrong with the CI tests on this, they're all green... |
vrothberg
left a comment
There was a problem hiding this comment.
The changes LGTM but I'd love us to have some tests as we could regress (for whatever) reason in Podman while Buildah continues working. Simple tests could be to use the different flags and use podman-inspect to make sure we have the expected amount of layers (e.g., podman inspect f945ea07f224 -f "{{len .RootFS.Layers}}"). We also should test that invalid combinations of the flags yield errors.
|
/lgtm |
|
Eeek. I didn't ack this PR. Without tests we are likely to silently regress. @TomSweeneyRedHat, mind opening another PR to add some tests? |
Translate the podman build --squash command to podman build --layers=false which
has the same functionality as docker build --squash. Add a new option --squash-all
which will squash all layers into one. This will be translated to buildah bud --squash
for the buildah bud api.
Also allow only one option, squash, layers or squash--all to be used per build command.
Fixes: containers/buildah#1234
Signed-off-by: TomSweeneyRedHat tsweeney@redhat.com