Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .tekton/operator-index-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,34 @@ spec:
- name: basic-auth
workspace: git-auth

- name: fbc-inject-lifecycle
taskRef:
resolver: bundles
params:
- name: kind
value: task
- name: name
value: fbc-inject-lifecycle-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-fbc-inject-lifecycle-oci-ta:0.1@sha256:da1217be1dcec3d5b5140ea351466607005481397b31f2b81108c4fd3012fbde
params:
- name: DOCKERFILE
value: $(params.dockerfile)
- name: CONTEXT
value: $(params.path-context)
- name: SOURCE_ARTIFACT
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
- name: ociStorage
value: $(params.output-image-repo):konflux-$(params.revision).lifecycle
- name: ociArtifactExpiresAfter
value: $(params.image-expires-after)
Comment on lines +239 to +240

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

bundle='quay.io/konflux-ci/tekton-catalog/task-fbc-inject-lifecycle-oci-ta:0.1@sha256:da1217be1dcec3d5b5140ea351466607005481397b31f2b81108c4fd3012fbde'

tkn bundle list -o yaml "$bundle" task fbc-inject-lifecycle-oci-ta |
  yq '{params: [.spec.params[].name], results: [.spec.results[].name]}'

rg -n -C 4 \
  'ociArtifactExpiresAfter|image-expires-after|oci-artifact-expires-after' \
  .tekton/operator-index-pipeline.yaml

Repository: stackrox/operator-index

Length of output: 238


Use the OCI-artifact retention parameter for lifecycle artifacts.

fbc-inject-lifecycle receives ociArtifactExpiresAfter as a new OCI intermediate-artifact expiry. Pipeline parameter image-expires-after defaults to an empty value, while oci-artifact-expires-after defaults to 1d and is already used for clone-repository. Pass $(params.oci-artifact-expires-after) here so lifecycle artifacts get the configured retention deadline.

Proposed fix
     - name: ociArtifactExpiresAfter
-      value: $(params.image-expires-after)
+      value: $(params.oci-artifact-expires-after)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: ociArtifactExpiresAfter
value: $(params.image-expires-after)
- name: ociArtifactExpiresAfter
value: $(params.oci-artifact-expires-after)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.tekton/operator-index-pipeline.yaml around lines 239 - 240, Update the
ociArtifactExpiresAfter parameter in the fbc-inject-lifecycle step to use
params.oci-artifact-expires-after instead of params.image-expires-after,
preserving the configured 1d default retention for lifecycle artifacts.

- name: BUILD_ARGS
value:
- base_image=$(params.base-image)
- catalog_dir=$(params.catalog-dir)
runAfter:
- clone-repository

- name: build-images
matrix:
params:
Expand All @@ -241,7 +269,7 @@ spec:
- base_image=$(params.base-image)
- catalog_dir=$(params.catalog-dir)
- name: SOURCE_ARTIFACT
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
value: $(tasks.fbc-inject-lifecycle.results.SOURCE_ARTIFACT)
- name: IMAGE_APPEND_PLATFORM
value: "true"
- name: BUILDAH_FORMAT
Expand Down Expand Up @@ -370,7 +398,7 @@ spec:
- name: image-url
value: $(tasks.build-image-index.results.IMAGE_URL)
- name: SOURCE_ARTIFACT
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
value: $(tasks.fbc-inject-lifecycle.results.SOURCE_ARTIFACT)
taskRef:
params:
- name: name
Expand Down