From ca6e878e5b0661952c9e03b606e84d251e548e1f Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Tue, 2 Jul 2024 11:48:39 -0400 Subject: [PATCH] Remove the squash_all parameter I got confused before. `podman build` has both a `--squash` and a `--squash-all` option. `buildah build` has only a `--squash` option which behaves like the `--squash-all` option from `podman build`. We _just_ added this param earlier this morning. Hopefully we can remove it here without needing a task version bump. --- task/buildah-oci-ta/0.1/README.md | 3 +-- task/buildah-oci-ta/0.1/buildah-oci-ta.yaml | 13 +------------ .../0.1/buildah-remote-oci-ta.yaml | 15 ++------------- task/buildah-remote/0.1/buildah-remote.yaml | 15 ++------------- task/buildah/0.1/README.md | 3 +-- task/buildah/0.1/buildah.yaml | 12 +----------- 6 files changed, 8 insertions(+), 53 deletions(-) diff --git a/task/buildah-oci-ta/0.1/README.md b/task/buildah-oci-ta/0.1/README.md index 551b0dc8b9..15ec8b62a6 100644 --- a/task/buildah-oci-ta/0.1/README.md +++ b/task/buildah-oci-ta/0.1/README.md @@ -23,8 +23,7 @@ When prefetch-dependencies task was activated it is using its artifacts to run b |IMAGE_EXPIRES_AFTER|Delete image tag after specified time. Empty means to keep the image tag. Time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.|""|false| |PREFETCH_INPUT|In case it is not empty, the prefetched content should be made available to the build.|""|false| |SOURCE_ARTIFACT|The Trusted Artifact URI pointing to the artifact with the application source code.||true| -|SQUASH|Squash new layers added as a part of this build, as per --squash|false|false| -|SQUASH_ALL|Squash all new and previous layers added as a part of this build, as per --squash-all|false|false| +|SQUASH|Squash all new and previous layers added as a part of this build, as per --squash|false|false| |TARGET_STAGE|Target stage in Dockerfile to build. If not specified, the Dockerfile is processed entirely to (and including) its last stage.|""|false| |TLSVERIFY|Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry)|true|false| |YUM_REPOS_D_FETCHED|Path in source workspace where dynamically-fetched repos are present|fetched.repos.d|false| diff --git a/task/buildah-oci-ta/0.1/buildah-oci-ta.yaml b/task/buildah-oci-ta/0.1/buildah-oci-ta.yaml index f3e38c902f..f5a6928297 100644 --- a/task/buildah-oci-ta/0.1/buildah-oci-ta.yaml +++ b/task/buildah-oci-ta/0.1/buildah-oci-ta.yaml @@ -82,13 +82,8 @@ spec: the application source code. type: string - name: SQUASH - description: Squash new layers added as a part of this build, as per - --squash - type: string - default: "false" - - name: SQUASH_ALL description: Squash all new and previous layers added as a part of this - build, as per --squash-all + build, as per --squash type: string default: "false" - name: TARGET_STAGE @@ -181,8 +176,6 @@ spec: value: $(params.IMAGE_EXPIRES_AFTER) - name: SQUASH value: $(params.SQUASH) - - name: SQUASH_ALL - value: $(params.SQUASH_ALL) - name: STORAGE_DRIVER value: vfs - name: TARGET_STAGE @@ -302,10 +295,6 @@ spec: BUILDAH_ARGS+=("--squash") fi - if [ "${SQUASH_ALL}" == "true" ]; then - BUILDAH_ARGS+=("--squash-all") - fi - if [ -f "/var/workdir/cachi2/cachi2.env" ]; then cp -r "/var/workdir/cachi2" /tmp/ chmod -R go+rwX /tmp/cachi2 diff --git a/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml b/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml index 036a7b5bd4..2ca6c1a77e 100644 --- a/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml +++ b/task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml @@ -81,14 +81,10 @@ spec: source code. name: SOURCE_ARTIFACT type: string - - default: "false" - description: Squash new layers added as a part of this build, as per --squash - name: SQUASH - type: string - default: "false" description: Squash all new and previous layers added as a part of this build, - as per --squash-all - name: SQUASH_ALL + as per --squash + name: SQUASH type: string - default: "" description: Target stage in Dockerfile to build. If not specified, the Dockerfile @@ -160,8 +156,6 @@ spec: value: $(params.IMAGE_EXPIRES_AFTER) - name: SQUASH value: $(params.SQUASH) - - name: SQUASH_ALL - value: $(params.SQUASH_ALL) - name: STORAGE_DRIVER value: vfs - name: TARGET_STAGE @@ -318,10 +312,6 @@ spec: BUILDAH_ARGS+=("--squash") fi - if [ "${SQUASH_ALL}" == "true" ]; then - BUILDAH_ARGS+=("--squash-all") - fi - if [ -f "/var/workdir/cachi2/cachi2.env" ]; then cp -r "/var/workdir/cachi2" /tmp/ chmod -R go+rwX /tmp/cachi2 @@ -416,7 +406,6 @@ spec: -e IMAGE="$IMAGE" \ -e IMAGE_EXPIRES_AFTER="$IMAGE_EXPIRES_AFTER" \ -e SQUASH="$SQUASH" \ - -e SQUASH_ALL="$SQUASH_ALL" \ -e STORAGE_DRIVER="$STORAGE_DRIVER" \ -e TARGET_STAGE="$TARGET_STAGE" \ -e TLSVERIFY="$TLSVERIFY" \ diff --git a/task/buildah-remote/0.1/buildah-remote.yaml b/task/buildah-remote/0.1/buildah-remote.yaml index 8f34ec8244..a6108c133d 100644 --- a/task/buildah-remote/0.1/buildah-remote.yaml +++ b/task/buildah-remote/0.1/buildah-remote.yaml @@ -105,14 +105,10 @@ spec: build' name: ADD_CAPABILITIES type: string - - default: "false" - description: Squash new layers added as a part of this build, as per --squash - name: SQUASH - type: string - default: "false" description: Squash all new and previous layers added as a part of this build, - as per --squash-all - name: SQUASH_ALL + as per --squash + name: SQUASH type: string - description: The platform to build on name: PLATFORM @@ -169,8 +165,6 @@ spec: value: $(params.ADD_CAPABILITIES) - name: SQUASH value: $(params.SQUASH) - - name: SQUASH_ALL - value: $(params.SQUASH_ALL) - name: BUILDER_IMAGE value: quay.io/redhat-appstudio/buildah:v1.31.0@sha256:34f12c7b72ec2c28f1ded0c494b428df4791c909f1f174dd21b8ed6a57cf5ddb volumeMounts: @@ -310,10 +304,6 @@ spec: BUILDAH_ARGS+=("--squash") fi - if [ "${SQUASH_ALL}" == "true" ]; then - BUILDAH_ARGS+=("--squash-all") - fi - if [ -f "$(workspaces.source.path)/cachi2/cachi2.env" ]; then cp -r "$(workspaces.source.path)/cachi2" /tmp/ chmod -R go+rwX /tmp/cachi2 @@ -415,7 +405,6 @@ spec: -e BUILD_ARGS_FILE="$BUILD_ARGS_FILE" \ -e ADD_CAPABILITIES="$ADD_CAPABILITIES" \ -e SQUASH="$SQUASH" \ - -e SQUASH_ALL="$SQUASH_ALL" \ -e COMMIT_SHA="$COMMIT_SHA" \ -v "$BUILD_DIR/workspaces/source:$(workspaces.source.path):Z" \ -v "$BUILD_DIR/volumes/shared:/shared:Z" \ diff --git a/task/buildah/0.1/README.md b/task/buildah/0.1/README.md index a9ffe69b9b..def5b2f122 100644 --- a/task/buildah/0.1/README.md +++ b/task/buildah/0.1/README.md @@ -26,8 +26,7 @@ When prefetch-dependencies task was activated it is using its artifacts to run b |ADDITIONAL_SECRET|Name of a secret which will be made available to the build with 'buildah build --secret' at /run/secrets/$ADDITIONAL_SECRET|does-not-exist|false| |BUILD_ARGS|Array of --build-arg values ("arg=value" strings)|[]|false| |BUILD_ARGS_FILE|Path to a file with build arguments, see https://www.mankier.com/1/buildah-build#--build-arg-file|""|false| -|SQUASH|Squash new layers added as a part of this build, as per --squash|false|false| -|SQUASH_ALL|Squash all new and previous layers added as a part of this build, as per --squash-all|false|false| +|SQUASH|Squash all new and previous layers added as a part of this build, as per --squash|false|false| ## Results |name|description| diff --git a/task/buildah/0.1/buildah.yaml b/task/buildah/0.1/buildah.yaml index 4758b67492..cf74553521 100644 --- a/task/buildah/0.1/buildah.yaml +++ b/task/buildah/0.1/buildah.yaml @@ -96,11 +96,7 @@ spec: type: string default: "" - name: SQUASH - description: Squash new layers added as a part of this build, as per --squash - type: string - default: "false" - - name: SQUASH_ALL - description: Squash all new and previous layers added as a part of this build, as per --squash-all + description: Squash all new and previous layers added as a part of this build, as per --squash type: string default: "false" @@ -157,8 +153,6 @@ spec: value: $(params.ADD_CAPABILITIES) - name: SQUASH value: $(params.SQUASH) - - name: SQUASH_ALL - value: $(params.SQUASH_ALL) steps: - image: quay.io/redhat-appstudio/buildah:v1.31.0@sha256:34f12c7b72ec2c28f1ded0c494b428df4791c909f1f174dd21b8ed6a57cf5ddb @@ -255,10 +249,6 @@ spec: BUILDAH_ARGS+=("--squash") fi - if [ "${SQUASH_ALL}" == "true" ]; then - BUILDAH_ARGS+=("--squash-all") - fi - if [ -f "$(workspaces.source.path)/cachi2/cachi2.env" ]; then cp -r "$(workspaces.source.path)/cachi2" /tmp/ chmod -R go+rwX /tmp/cachi2