Skip to content

Handle signing OCI artifacts in *ARTIFACT_OUTPUTS#1578

Open
bradbeck wants to merge 1 commit intotektoncd:mainfrom
bradbeck:sign-artifact-outputs
Open

Handle signing OCI artifacts in *ARTIFACT_OUTPUTS#1578
bradbeck wants to merge 1 commit intotektoncd:mainfrom
bradbeck:sign-artifact-outputs

Conversation

@bradbeck
Copy link
Copy Markdown
Contributor

@bradbeck bradbeck commented Mar 6, 2026

Changes

Handle signing OCI artifacts that are hinted using *ARTIFACT_OUTPUTS

Fixes #1575

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Sign OCI artifacts hinted by `*ARTIFACT_OUTPUTS` and `isbuildArtifact: true`

Handle signing OCI artifacts that are hinted using *ARTIFACT_OUTPUTS

Fixes tektoncd#1575

Signed-off-by: Brad Beck <bradley.beck@gmail.com>
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 6, 2026
@arewm
Copy link
Copy Markdown
Contributor

arewm commented Mar 9, 2026

I previously opened an issue that Chains should stop signing type-hinted artifacts: #1346

If that is implemented, would we just have to back this out as well?

@anithapriyanatarajan
Copy link
Copy Markdown
Contributor

I previously opened an issue that Chains should stop signing type-hinted artifacts: #1346

If that is implemented, would we just have to back this out as well?

@arewm - If the user intends to use Chains for image signing as well, this PR is needed. If the user intends not to sign the image artifact through the Chains controller, this will not take effect based on the configmap value as done with #1419 This PR handles the issue that you have created. Hope this helps

Copy link
Copy Markdown
Member

@jkhelil jkhelil left a comment

Choose a reason for hiding this comment

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

@bradbeck please add release note

}
}

// Also check structured ARTIFACT_OUTPUTS for OCI artifacts that are marked as build artifacts
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what happens if artifact is declared via both IMAGE_URL/IMAGE_DIGEST and ARTIFACT_OUTPUTS ?
are falling in double signing ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What is the current behavior when both IMAGE_URL/IMAGE_DIGEST & IMAGES define the same artifact?

@anithapriyanatarajan
Copy link
Copy Markdown
Contributor

@bradbeck Thank you for this PR. I have verified the double signing behavior for both combinations:
IMAGE_DIGEST + IMAGE_URL + IMAGES results in duplicate .sig layers (2 identical payloads, 2 independent signatures)
IMAGE_DIGEST + IMAGE_URL + ARTIFACT_OUTPUTS results in duplicate .att layers (same attestation stored twice)
Filed as [#1596] with reproduction steps and oras/cosign output confirming both cases.

The root cause on initial analysis with Claude is no deduplication in [ExtractOCIImagesFromResults] which is pre-existing and this PR has surfaced it by adding a third loop. I'd suggest merging this PR as-is and tracking the deduplication fix as a separate follow-up.

@jkhelil , would you prefer a follow-up PR for the deduplication? The test cases would need to cover each type-hint combination independently and in combination, so it is cleaner to handle separately rather than expanding the scope of this PR. Thank you.

@ab-ghosh
Copy link
Copy Markdown
Member

ab-ghosh commented Apr 2, 2026

The duplicate signing concern from overlapping result formats is addressed in #1601

@ab-ghosh
Copy link
Copy Markdown
Member

ab-ghosh commented Apr 2, 2026

/lgtm

@tekton-robot
Copy link
Copy Markdown

@ab-ghosh: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign wlynch after the PR has been reviewed.
You can assign the PR to them by writing /assign @wlynch in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OCI Artifacts in *ARTIFACT_OUTPUTS are not signed

6 participants