Skip to content

fix: pass insecure option to name.NewDigest for OCI storage#1684

Open
ab-ghosh wants to merge 1 commit into
tektoncd:mainfrom
ab-ghosh:fix/oci-insecure-digest-option
Open

fix: pass insecure option to name.NewDigest for OCI storage#1684
ab-ghosh wants to merge 1 commit into
tektoncd:mainfrom
ab-ghosh:fix/oci-insecure-digest-option

Conversation

@ab-ghosh
Copy link
Copy Markdown
Member

@ab-ghosh ab-ghosh commented May 26, 2026

Changes

Fix OCI storage failing against insecure .cluster.local registries when using go-containerregistry v0.21.6+.
name.NewDigest() was called without name.Insecure even when storage.oci.repository.insecure: "true" was configured, causing HTTPS connections to plain HTTP registries.
Extract nameOpts() helper from newRepo() and reuse it inuploadSignature() and uploadAttestation() for consistent insecure flag propagation.

Context

go-containerregistry v0.21.6 tightened .local domain handling (google/go-containerregistry#2281) —
only .localhost is now treated as HTTP by default. Domains like registry.<ns>.svc.cluster.local:5000 previously worked without the insecure flag but now require it explicitly.

This fix unblocks the dependency bump in #1680, which updates go-containerregistry to v0.21.6 and currently fails all e2e tests due to this issue.

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

Fix OCI signature and attestation uploads to correctly honour `storage.oci.repository.insecure: "true"` for plain-HTTP in-cluster registries, restoring compatibility with go-containerregistry v0.21.6+

@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 ask for approval from ab-ghosh after the PR has been reviewed.

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

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 26, 2026
@anithapriyanatarajan
Copy link
Copy Markdown
Contributor

/kind misc

@tekton-robot tekton-robot added the kind/misc Categorizes issue or PR as a miscellaneuous one. label May 26, 2026
@anithapriyanatarajan
Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 26, 2026
@ab-ghosh ab-ghosh force-pushed the fix/oci-insecure-digest-option branch from 0e9362a to d304a5d Compare May 26, 2026 12:20
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label May 26, 2026
@ab-ghosh
Copy link
Copy Markdown
Member Author

/retest

  go-containerregistry v0.21.6 changed .local domain handling to only
  treat .localhost as HTTP (google/go-containerregistry#2281). This
  breaks OCI storage for insecure registries using .cluster.local
  addresses since name.NewDigest() now defaults to HTTPS for them.

  Extract nameOpts() from newRepo() and reuse it in both NewDigest
  call sites so the insecure flag propagates consistently.

Signed-off-by: ab-ghosh <abghosh@redhat.com>
@ab-ghosh ab-ghosh force-pushed the fix/oci-insecure-digest-option branch from d304a5d to 6d97fce Compare May 26, 2026 12:33
@ab-ghosh
Copy link
Copy Markdown
Member Author

/retest

@anithapriyanatarajan
Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 2, 2026
@ab-ghosh
Copy link
Copy Markdown
Member Author

ab-ghosh commented Jun 3, 2026

/cc @jkhelil

@tekton-robot tekton-robot requested a review from jkhelil June 3, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. 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.

3 participants