Skip to content

Commit 6f3b6eb

Browse files
committed
Konflux-build-cli: replace build step of build-image-index task
Start using the konflux-build-cli for building the image index. Related PR: konflux-ci/konflux-build-cli#69 Also NOTE: The build step is now run explicitly as root by using runAsUser: 0, since the permissions for the "konflux-build-cli" container are different and they no longer allow executing the necessary setup steps, like updating the ca-trust. The step was always run with root permissions, now it us just explicitly setup in the tekton step. STONEBLD-4060 Assisted-by: Claude Signed-off-by: mkosiarc <mkosiarc@redhat.com>
1 parent 338164b commit 6f3b6eb

File tree

38 files changed

+581
-281
lines changed

38 files changed

+581
-281
lines changed

.tekton/pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: build-definitions-pull-request
66
annotations:
77
pipelinesascode.tekton.dev/on-cel-expression: (event == "pull_request" && target_branch == "main" && ( !has(body.pull_request) || !body.pull_request.draft) ) || (event == "push" && target_branch.startsWith("gh-readonly-queue/main/") && body.head_commit != "null" )
8-
pipelinesascode.tekton.dev/task: "[task/git-clone/0.1/git-clone.yaml, task/buildah-remote/0.8/buildah-remote.yaml, task/build-image-index/0.2/build-image-index.yaml, .tekton/tasks/task-lint.yaml, .tekton/tasks/e2e-test.yaml, .tekton/tasks/task-switchboard.yaml]"
8+
pipelinesascode.tekton.dev/task: "[task/git-clone/0.1/git-clone.yaml, task/buildah-remote/0.8/buildah-remote.yaml, task/build-image-index/0.3/build-image-index.yaml, .tekton/tasks/task-lint.yaml, .tekton/tasks/e2e-test.yaml, .tekton/tasks/task-switchboard.yaml]"
99
pipelinesascode.tekton.dev/max-keep-runs: "5"
1010
spec:
1111
params:

.tekton/push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
annotations:
77
pipelinesascode.tekton.dev/on-event: "push"
88
pipelinesascode.tekton.dev/on-target-branch: "main"
9-
pipelinesascode.tekton.dev/task: "[task/update-infra-deployments/0.1/update-infra-deployments.yaml, task/git-clone/0.1/git-clone.yaml, task/buildah-remote/0.8/buildah-remote.yaml, task/build-image-index/0.2/build-image-index.yaml, task/slack-webhook-notification/0.1/slack-webhook-notification.yaml, .tekton/tasks/ec-checks.yaml, task/apply-tags/0.2/apply-tags.yaml]"
9+
pipelinesascode.tekton.dev/task: "[task/update-infra-deployments/0.1/update-infra-deployments.yaml, task/git-clone/0.1/git-clone.yaml, task/buildah-remote/0.8/buildah-remote.yaml, task/build-image-index/0.3/build-image-index.yaml, task/slack-webhook-notification/0.1/slack-webhook-notification.yaml, .tekton/tasks/ec-checks.yaml, task/apply-tags/0.2/apply-tags.yaml]"
1010
pipelinesascode.tekton.dev/max-keep-runs: "5"
1111
spec:
1212
params:

pipelines/core-services/core-services.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,6 @@ spec:
253253
params:
254254
- name: IMAGE
255255
value: $(params.output-image)
256-
- name: COMMIT_SHA
257-
value: $(tasks.clone-repository.results.commit)
258-
- name: IMAGE_EXPIRES_AFTER
259-
value: $(params.image-expires-after)
260256
- name: ALWAYS_BUILD_INDEX
261257
value: $(params.build-image-index)
262258
- name: IMAGES
@@ -268,7 +264,7 @@ spec:
268264
- build-images
269265
taskRef:
270266
name: build-image-index
271-
version: "0.2"
267+
version: "0.3"
272268
- name: build-source-image
273269
params:
274270
- name: BINARY_IMAGE

pipelines/core-services/patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
# build-image-index
5353
- op: replace
54-
path: /spec/tasks/4/params/4/value # IMAGES
54+
path: /spec/tasks/4/params/2/value # IMAGES
5555
value:
5656
- $(tasks.build-images.results.IMAGE_REF[*])
5757
- op: replace

pipelines/docker-build-multi-platform-oci-ta/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
99
|---|---|---|---|
1010
|build-args| Array of --build-arg values ("arg=value" strings) for buildah| []| build-images:0.9:BUILD_ARGS ; sast-coverity-check:0.3:BUILD_ARGS|
1111
|build-args-file| Path to a file with build arguments for buildah, see https://www.mankier.com/1/buildah-build#--build-arg-file| | build-images:0.9:BUILD_ARGS_FILE ; sast-coverity-check:0.3:BUILD_ARGS_FILE|
12-
|build-image-index| Add built image into an OCI image index| true| build-image-index:0.2:ALWAYS_BUILD_INDEX|
12+
|build-image-index| Add built image into an OCI image index| true| build-image-index:0.3:ALWAYS_BUILD_INDEX|
1313
|build-platforms| List of platforms to build the container images on. The available set of values is determined by the configuration of the multi-platform-controller.| ['linux/x86_64']| |
1414
|build-source-image| Build a source image.| false| |
15-
|buildah-format| The format for the resulting image's mediaType. Valid values are oci or docker.| docker| build-images:0.9:BUILDAH_FORMAT ; build-image-index:0.2:BUILDAH_FORMAT|
15+
|buildah-format| The format for the resulting image's mediaType. Valid values are oci or docker.| docker| build-images:0.9:BUILDAH_FORMAT ; build-image-index:0.3:BUILDAH_FORMAT|
1616
|dockerfile| Path to the Dockerfile inside the context specified by parameter path-context| Dockerfile| build-images:0.9:DOCKERFILE ; sast-coverity-check:0.3:DOCKERFILE ; push-dockerfile:0.3:DOCKERFILE|
1717
|enable-cache-proxy| Enable cache proxy configuration| false| init:0.4:enable-cache-proxy|
1818
|git-url| Source Repository URL| None| clone-repository:0.1:url|
1919
|hermetic| Execute the build with network isolation| false| build-images:0.9:HERMETIC ; sast-coverity-check:0.3:HERMETIC|
20-
|image-expires-after| Image tag expiration time, time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.| | clone-repository:0.1:ociArtifactExpiresAfter ; prefetch-dependencies:0.3:ociArtifactExpiresAfter ; build-images:0.9:IMAGE_EXPIRES_AFTER ; build-image-index:0.2:IMAGE_EXPIRES_AFTER ; sast-coverity-check:0.3:IMAGE_EXPIRES_AFTER|
21-
|output-image| Fully Qualified Output Image| None| clone-repository:0.1:ociStorage ; prefetch-dependencies:0.3:ociStorage ; build-images:0.9:IMAGE ; build-image-index:0.2:IMAGE ; sast-coverity-check:0.3:IMAGE|
20+
|image-expires-after| Image tag expiration time, time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.| | clone-repository:0.1:ociArtifactExpiresAfter ; prefetch-dependencies:0.3:ociArtifactExpiresAfter ; build-images:0.9:IMAGE_EXPIRES_AFTER ; sast-coverity-check:0.3:IMAGE_EXPIRES_AFTER|
21+
|output-image| Fully Qualified Output Image| None| clone-repository:0.1:ociStorage ; prefetch-dependencies:0.3:ociStorage ; build-images:0.9:IMAGE ; build-image-index:0.3:IMAGE ; sast-coverity-check:0.3:IMAGE|
2222
|path-context| Path to the source code of an application's component from where to build image.| .| build-images:0.9:CONTEXT ; sast-coverity-check:0.3:CONTEXT ; push-dockerfile:0.3:CONTEXT|
2323
|prefetch-input| Build dependencies to be prefetched| | prefetch-dependencies:0.3:input ; build-images:0.9:PREFETCH_INPUT ; sast-coverity-check:0.3:PREFETCH_INPUT|
2424
|privileged-nested| Whether to enable privileged mode, should be used only with remote VMs| false| build-images:0.9:PRIVILEGED_NESTED|
@@ -35,15 +35,13 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
3535
|IMAGE_DIGEST| Image digest of the built image.| None| '$(tasks.build-image-index.results.IMAGE_DIGEST)'|
3636
|IMAGE_URL| Image repository and tag reference of the the built image.| None| '$(tasks.build-image-index.results.IMAGE_URL)'|
3737
|LOG_LEVEL| Log level to use in the task. See golang logrus docs for available levels.| info| |
38-
### build-image-index:0.2 task parameters
38+
### build-image-index:0.3 task parameters
3939
|name|description|default value|already set by|
4040
|---|---|---|---|
4141
|ALWAYS_BUILD_INDEX| Build an image index even if IMAGES is of length 1. Default true. If the image index generation is skipped, the task will forward values for params.IMAGES[0] to results.IMAGE_*. In order to properly set all results, use the repository:tag@sha256:digest format for the IMAGES parameter.| true| '$(params.build-image-index)'|
4242
|BUILDAH_FORMAT| The format for the resulting image's mediaType. Valid values are oci (default) or docker.| oci| '$(params.buildah-format)'|
43-
|COMMIT_SHA| The commit the image is built from.| ""| '$(tasks.clone-repository.results.commit)'|
4443
|IMAGE| The target image and tag where the image will be pushed to.| None| '$(params.output-image)'|
4544
|IMAGES| List of Image Manifests to be referenced by the Image Index| None| '['$(tasks.build-images.results.IMAGE_REF[*])']'|
46-
|IMAGE_EXPIRES_AFTER| Delete image tag after specified time resulting in garbage collection of the digest. Empty means to keep the image tag. Time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.| ""| '$(params.image-expires-after)'|
4745
|SBOM_SKIP_VALIDATION| Flag to enable or disable SBOM validation before save. Validation is optional - use this if you are experiencing performance issues.| false| |
4846
|STORAGE_DRIVER| Storage driver to configure for buildah| vfs| |
4947
|TLSVERIFY| Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry)| true| |
@@ -329,7 +327,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
329327
|IMAGE_DIGEST| |$(tasks.build-image-index.results.IMAGE_DIGEST)|
330328
|IMAGE_URL| |$(tasks.build-image-index.results.IMAGE_URL)|
331329
## Available results from tasks
332-
### build-image-index:0.2 task results
330+
### build-image-index:0.3 task results
333331
|name|description|used in params (taskname:taskrefversion:taskparam)
334332
|---|---|---|
335333
|IMAGES| List of all referenced image manifests| |
@@ -341,7 +339,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
341339
|name|description|used in params (taskname:taskrefversion:taskparam)
342340
|---|---|---|
343341
|IMAGE_DIGEST| Digest of the image just built| |
344-
|IMAGE_REF| Image reference of the built image| build-image-index:0.2:IMAGES|
342+
|IMAGE_REF| Image reference of the built image| build-image-index:0.3:IMAGES|
345343
|IMAGE_URL| Image repository and tag where the built image was pushed| |
346344
|SBOM_BLOB_URL| Reference of SBOM blob digest to enable digest-based verification from provenance| |
347345
### clair-scan:0.3 task results
@@ -379,7 +377,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
379377
|CHAINS-GIT_COMMIT| The precise commit SHA that was fetched by this Task. This result uses Chains type hinting to include in the provenance.| |
380378
|CHAINS-GIT_URL| The precise URL that was fetched by this Task. This result uses Chains type hinting to include in the provenance.| |
381379
|SOURCE_ARTIFACT| The Trusted Artifact URI pointing to the artifact with the application source code.| prefetch-dependencies:0.3:SOURCE_ARTIFACT|
382-
|commit| The precise commit SHA that was fetched by this Task.| build-images:0.9:COMMIT_SHA ; build-image-index:0.2:COMMIT_SHA ; sast-coverity-check:0.3:COMMIT_SHA|
380+
|commit| The precise commit SHA that was fetched by this Task.| build-images:0.9:COMMIT_SHA ; sast-coverity-check:0.3:COMMIT_SHA|
383381
|commit-timestamp| The commit timestamp of the checkout| |
384382
|merged_sha| The SHA of the commit after merging the target branch (if the param mergeTargetBranch is true).| |
385383
|short-commit| The commit SHA that was fetched by this Task limited to params.shortCommitLength number of characters| |

pipelines/docker-build-multi-platform-oci-ta/docker-build-multi-platform-oci-ta.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,6 @@ spec:
194194
params:
195195
- name: IMAGE
196196
value: $(params.output-image)
197-
- name: COMMIT_SHA
198-
value: $(tasks.clone-repository.results.commit)
199-
- name: IMAGE_EXPIRES_AFTER
200-
value: $(params.image-expires-after)
201197
- name: ALWAYS_BUILD_INDEX
202198
value: $(params.build-image-index)
203199
- name: IMAGES
@@ -209,7 +205,7 @@ spec:
209205
- build-images
210206
taskRef:
211207
name: build-image-index
212-
version: "0.2"
208+
version: "0.3"
213209
- name: build-source-image
214210
params:
215211
- name: BINARY_IMAGE

pipelines/docker-build-multi-platform-oci-ta/patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
# build-image-index
4848
- op: replace
49-
path: /spec/tasks/4/params/4/value # IMAGES
49+
path: /spec/tasks/4/params/2/value # IMAGES
5050
value:
5151
- $(tasks.build-images.results.IMAGE_REF[*])
5252
- op: replace

pipelines/docker-build-oci-ta-min/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,28 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
1111
|---|---|---|---|
1212
|build-args| Array of --build-arg values ("arg=value" strings) for buildah| []| build-container:0.9:BUILD_ARGS|
1313
|build-args-file| Path to a file with build arguments for buildah, see https://www.mankier.com/1/buildah-build#--build-arg-file| | build-container:0.9:BUILD_ARGS_FILE|
14-
|build-image-index| Add built image into an OCI image index| false| build-image-index:0.2:ALWAYS_BUILD_INDEX|
15-
|buildah-format| The format for the resulting image's mediaType. Valid values are oci or docker.| docker| build-container:0.9:BUILDAH_FORMAT ; build-image-index:0.2:BUILDAH_FORMAT|
14+
|build-image-index| Add built image into an OCI image index| false| build-image-index:0.3:ALWAYS_BUILD_INDEX|
15+
|buildah-format| The format for the resulting image's mediaType. Valid values are oci or docker.| docker| build-container:0.9:BUILDAH_FORMAT ; build-image-index:0.3:BUILDAH_FORMAT|
1616
|dockerfile| Path to the Dockerfile inside the context specified by parameter path-context| Dockerfile| build-container:0.9:DOCKERFILE|
1717
|enable-cache-proxy| Enable cache proxy configuration| false| init:0.4:enable-cache-proxy|
1818
|git-url| Source Repository URL| None| clone-repository:0.1:url|
1919
|hermetic| Execute the build with network isolation| false| build-container:0.9:HERMETIC|
20-
|image-expires-after| Image tag expiration time, time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.| | clone-repository:0.1:ociArtifactExpiresAfter ; prefetch-dependencies:0.3:ociArtifactExpiresAfter ; build-container:0.9:IMAGE_EXPIRES_AFTER ; build-image-index:0.2:IMAGE_EXPIRES_AFTER|
21-
|output-image| Fully Qualified Output Image| None| clone-repository:0.1:ociStorage ; prefetch-dependencies:0.3:ociStorage ; build-container:0.9:IMAGE ; build-image-index:0.2:IMAGE|
20+
|image-expires-after| Image tag expiration time, time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.| | clone-repository:0.1:ociArtifactExpiresAfter ; prefetch-dependencies:0.3:ociArtifactExpiresAfter ; build-container:0.9:IMAGE_EXPIRES_AFTER|
21+
|output-image| Fully Qualified Output Image| None| clone-repository:0.1:ociStorage ; prefetch-dependencies:0.3:ociStorage ; build-container:0.9:IMAGE ; build-image-index:0.3:IMAGE|
2222
|path-context| Path to the source code of an application's component from where to build image.| .| build-container:0.9:CONTEXT|
2323
|prefetch-input| Build dependencies to be prefetched| | prefetch-dependencies:0.3:input ; build-container:0.9:PREFETCH_INPUT|
2424
|privileged-nested| Whether to enable privileged mode, should be used only with remote VMs| false| build-container:0.9:PRIVILEGED_NESTED|
2525
|revision| Revision of the Source Repository| | clone-repository:0.1:revision|
2626
|skip-checks| Skip checks against built image| false| |
2727

2828
## Available params from tasks
29-
### build-image-index-min:0.2 task parameters
29+
### build-image-index-min:0.3 task parameters
3030
|name|description|default value|already set by|
3131
|---|---|---|---|
3232
|ALWAYS_BUILD_INDEX| Build an image index even if IMAGES is of length 1. Default true. If the image index generation is skipped, the task will forward values for params.IMAGES[0] to results.IMAGE_*. In order to properly set all results, use the repository:tag@sha256:digest format for the IMAGES parameter.| true| '$(params.build-image-index)'|
3333
|BUILDAH_FORMAT| The format for the resulting image's mediaType. Valid values are oci (default) or docker.| oci| '$(params.buildah-format)'|
34-
|COMMIT_SHA| The commit the image is built from.| ""| '$(tasks.clone-repository.results.commit)'|
3534
|IMAGE| The target image and tag where the image will be pushed to.| None| '$(params.output-image)'|
3635
|IMAGES| List of Image Manifests to be referenced by the Image Index| None| '['$(tasks.build-container.results.IMAGE_URL)@$(tasks.build-container.results.IMAGE_DIGEST)']'|
37-
|IMAGE_EXPIRES_AFTER| Delete image tag after specified time resulting in garbage collection of the digest. Empty means to keep the image tag. Time values could be something like 1h, 2d, 3w for hours, days, and weeks, respectively.| ""| '$(params.image-expires-after)'|
3836
|SBOM_SKIP_VALIDATION| Flag to enable or disable SBOM validation before save. Validation is optional - use this if you are experiencing performance issues.| false| |
3937
|STORAGE_DRIVER| Storage driver to configure for buildah| vfs| |
4038
|TLSVERIFY| Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry)| true| |
@@ -224,7 +222,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
224222
|IMAGE_DIGEST| |$(tasks.build-image-index.results.IMAGE_DIGEST)|
225223
|IMAGE_URL| |$(tasks.build-image-index.results.IMAGE_URL)|
226224
## Available results from tasks
227-
### build-image-index-min:0.2 task results
225+
### build-image-index-min:0.3 task results
228226
|name|description|used in params (taskname:taskrefversion:taskparam)
229227
|---|---|---|
230228
|IMAGES| List of all referenced image manifests| |
@@ -237,7 +235,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
237235
|---|---|---|
238236
|IMAGE_DIGEST| Digest of the image just built| |
239237
|IMAGE_REF| Image reference of the built image| |
240-
|IMAGE_URL| Image repository and tag where the built image was pushed| build-image-index:0.2:IMAGES|
238+
|IMAGE_URL| Image repository and tag where the built image was pushed| build-image-index:0.3:IMAGES|
241239
|SBOM_BLOB_URL| Reference of SBOM blob digest to enable digest-based verification from provenance| |
242240
### clair-scan-min:0.3 task results
243241
|name|description|used in params (taskname:taskrefversion:taskparam)
@@ -262,7 +260,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
262260
|CHAINS-GIT_COMMIT| The precise commit SHA that was fetched by this Task. This result uses Chains type hinting to include in the provenance.| |
263261
|CHAINS-GIT_URL| The precise URL that was fetched by this Task. This result uses Chains type hinting to include in the provenance.| |
264262
|SOURCE_ARTIFACT| The Trusted Artifact URI pointing to the artifact with the application source code.| prefetch-dependencies:0.3:SOURCE_ARTIFACT|
265-
|commit| The precise commit SHA that was fetched by this Task.| build-container:0.9:COMMIT_SHA ; build-image-index:0.2:COMMIT_SHA|
263+
|commit| The precise commit SHA that was fetched by this Task.| build-container:0.9:COMMIT_SHA|
266264
|commit-timestamp| The commit timestamp of the checkout| |
267265
|merged_sha| The SHA of the commit after merging the target branch (if the param mergeTargetBranch is true).| |
268266
|short-commit| The commit SHA that was fetched by this Task limited to params.shortCommitLength number of characters| |

pipelines/docker-build-oci-ta-min/docker-build-oci-ta-min.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ spec:
179179
params:
180180
- name: IMAGE
181181
value: $(params.output-image)
182-
- name: COMMIT_SHA
183-
value: $(tasks.clone-repository.results.commit)
184-
- name: IMAGE_EXPIRES_AFTER
185-
value: $(params.image-expires-after)
186182
- name: ALWAYS_BUILD_INDEX
187183
value: $(params.build-image-index)
188184
- name: IMAGES
@@ -194,7 +190,7 @@ spec:
194190
- build-container
195191
taskRef:
196192
name: build-image-index-min
197-
version: "0.2"
193+
version: "0.3"
198194
- name: deprecated-base-image-check
199195
params:
200196
- name: IMAGE_URL

0 commit comments

Comments
 (0)