Skip to content

fix: host builder can push to OCP internal registry - #3885

Merged
knative-prow[bot] merged 1 commit into
knative:mainfrom
matejvasek:fix-ocp-oci-bug
Jun 8, 2026
Merged

fix: host builder can push to OCP internal registry#3885
knative-prow[bot] merged 1 commit into
knative:mainfrom
matejvasek:fix-ocp-oci-bug

Conversation

@matejvasek

Copy link
Copy Markdown
Contributor

Summary

  • Fix OCI pusher failing to push images to OpenShift's internal registry when the repository doesn't exist yet
  • OpenShift's registry returns HTTP 500 for manifest HEAD requests by digest on non-existent repos, which breaks remote.WriteIndex since it checks child manifests by digest
  • Before writing the index, do a HEAD by tag to check repo existence; on 404, push an empty image to create the repo first, then proceed with the full index push

OpenShift's internal registry returns HTTP 500 for manifest HEAD
requests by digest when the repository doesn't exist yet. Since
remote.WriteIndex checks child manifests by digest, the push fails
on a fresh repository.

Before writing the index, perform a HEAD request by tag. If the
registry returns 404, push an empty image to create the repository
first. The empty image tag is then overwritten by the index push.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
@knative-prow knative-prow Bot added the approved 🤖 PR has been approved by an approver from all required OWNERS files. label Jun 8, 2026
@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos June 8, 2026 19:24
@knative-prow knative-prow Bot added the size/S 🤖 PR changes 10-29 lines, ignoring generated files. label Jun 8, 2026
@matejvasek
matejvasek requested review from gauron99 and lkingland and removed request for jrangelramos June 8, 2026 19:24
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.98%. Comparing base (a6ba689) to head (c20b65f).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/oci/pusher.go 40.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3885      +/-   ##
==========================================
- Coverage   54.03%   53.98%   -0.05%     
==========================================
  Files         200      200              
  Lines       23567    23566       -1     
==========================================
- Hits        12734    12723      -11     
- Misses       9604     9612       +8     
- Partials     1229     1231       +2     
Flag Coverage Δ
e2e 33.50% <40.00%> (+0.01%) ⬆️
e2e go 29.42% <50.00%> (+0.01%) ⬆️
e2e node 25.73% <0.00%> (+<0.01%) ⬆️
e2e python 29.76% <50.00%> (+0.01%) ⬆️
e2e quarkus 25.86% <0.00%> (+<0.01%) ⬆️
e2e rust 25.33% <0.00%> (+0.01%) ⬆️
e2e springboot 24.01% <0.00%> (+<0.01%) ⬆️
e2e typescript 25.85% <0.00%> (+<0.01%) ⬆️
e2e-config-ci 26.97% <50.00%> (+0.01%) ⬆️
integration 15.70% <0.00%> (-0.03%) ⬇️
unit macos-14 42.88% <50.00%> (-0.04%) ⬇️
unit macos-latest 42.88% <50.00%> (-0.04%) ⬇️
unit ubuntu-24.04-arm 43.20% <40.00%> (-0.04%) ⬇️
unit ubuntu-latest 43.74% <50.00%> (-0.04%) ⬇️
unit windows-latest 42.95% <50.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gauron99 gauron99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Jun 8, 2026
@knative-prow

knative-prow Bot commented Jun 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99, matejvasek

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [gauron99,matejvasek]

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

@knative-prow
knative-prow Bot merged commit dfabe19 into knative:main Jun 8, 2026
44 checks passed
@matejvasek

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-1.22

@matejvasek

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-1.21

@knative-prow-robot

Copy link
Copy Markdown

@matejvasek: new pull request created: #3886

Details

In response to this:

/cherry-pick release-1.22

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-sigs/prow repository.

@knative-prow-robot

Copy link
Copy Markdown

@matejvasek: new pull request created: #3887

Details

In response to this:

/cherry-pick release-1.21

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-sigs/prow repository.

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

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. lgtm 🤖 PR is ready to be merged. size/S 🤖 PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants