From 44d5475deda81d322b2fc6253b2c6977f1e3b25d Mon Sep 17 00:00:00 2001 From: Adam Cmiel Date: Mon, 22 Jul 2024 14:46:12 +0200 Subject: [PATCH] rpm-ostree 0.2: drop BASE_IMAGES_DIGESTS STONEBLD-2326 The result never provided any value. Drop it. Signed-off-by: Adam Cmiel --- task/rpm-ostree/0.2/MIGRATION.md | 43 +++++++++++++++++++++++++++++ task/rpm-ostree/0.2/rpm-ostree.yaml | 5 ---- 2 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 task/rpm-ostree/0.2/MIGRATION.md diff --git a/task/rpm-ostree/0.2/MIGRATION.md b/task/rpm-ostree/0.2/MIGRATION.md new file mode 100644 index 0000000000..3a9ab10b20 --- /dev/null +++ b/task/rpm-ostree/0.2/MIGRATION.md @@ -0,0 +1,43 @@ +# Migration from 0.1 to 0.2 + +Version 0.2: + +* Removes the `BASE_IMAGES_DIGESTS` result. Please remove all the references to this + result from your pipeline. + * Note that the result never provided any value. It did not contain base image + digests, it contained a local-only reference for the **output** image + (`localhost/rhtap-final-image@sha256:...`). The task returns a usable reference + for the output image as well (`IMAGE_URL` + `IMAGE_DIGEST`). + +## Konflux-specific + +In a typical Konflux pipeline, the two tasks that used to depend on the `BASE_IMAGES_DIGESTS` +result are `build-source-image` and `deprecated-base-image-check`. + +1. Make sure your version of `deprecated-base-image-check` is at least `0.4`. +2. Remove the parameters that reference the `BASE_IMAGES_DIGESTS` result: + +```diff +@@ -255,10 +255,8 @@ spec: + - name: build-source-image + params: + - name: BINARY_IMAGE + value: $(params.output-image) +- - name: BASE_IMAGES +- value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS) + runAfter: + - build-container + taskRef: + params: +@@ -282,10 +280,8 @@ spec: + - name: workspace + workspace: workspace + - name: deprecated-base-image-check + params: +- - name: BASE_IMAGES_DIGESTS +- value: $(tasks.build-container.results.BASE_IMAGES_DIGESTS) + - name: IMAGE_URL + value: $(tasks.build-container.results.IMAGE_URL) + - name: IMAGE_DIGEST + value: $(tasks.build-container.results.IMAGE_DIGEST) +``` diff --git a/task/rpm-ostree/0.2/rpm-ostree.yaml b/task/rpm-ostree/0.2/rpm-ostree.yaml index b86f48a496..ca472151f3 100644 --- a/task/rpm-ostree/0.2/rpm-ostree.yaml +++ b/task/rpm-ostree/0.2/rpm-ostree.yaml @@ -62,8 +62,6 @@ spec: name: IMAGE_URL - description: Image reference of the built image name: IMAGE_REF - - description: Digests of the base images used for build - name: BASE_IMAGES_DIGESTS - name: SBOM_BLOB_URL description: Reference, including digest to the SBOM blob stepTemplate: @@ -234,9 +232,6 @@ spec: computeResources: {} script: | #!/bin/bash - # Expose base image digests - buildah images --format '{{ .Name }}:{{ .Tag }}@{{ .Digest }}' | grep -v $IMAGE > $(results.BASE_IMAGES_DIGESTS.path) - base_image_name=$(buildah inspect --format '{{ index .ImageAnnotations "org.opencontainers.image.base.name"}}' $IMAGE | cut -f1 -d'@') base_image_digest=$(buildah inspect --format '{{ index .ImageAnnotations "org.opencontainers.image.base.digest"}}' $IMAGE) container=$(buildah from --pull-never $IMAGE)