Set override_path = true to namespaced hosts.toml entries in hosts.toml#10765
Open
rahulbabu95 wants to merge 1 commit into
Open
Set override_path = true to namespaced hosts.toml entries in hosts.toml#10765rahulbabu95 wants to merge 1 commit into
override_path = true to namespaced hosts.toml entries in hosts.toml#10765rahulbabu95 wants to merge 1 commit into
Conversation
Collaborator
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10765 +/- ##
=======================================
Coverage 72.30% 72.31%
=======================================
Files 608 608
Lines 39388 39402 +14
=======================================
+ Hits 28481 28493 +12
- Misses 9173 9176 +3
+ Partials 1734 1733 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… v2 migration URLs are used as-is) to hosts.toml format (where containerd auto-appends /v2/ to the host path). Since ToAPIEndpoints() already prepends /v2/ before the namespace, containerd produced a broken double /v2/ in requests: /v2/<namespace>/v2/<repo>/manifests/<tag> → 404. Fix: Always set override_path = true in hosts.toml entries so containerd uses the host path as-is without auto-appending /v2/. Also update ToAPIEndpoint to always produce a /v2 path prefix (even for pathless URLs) ensuring all entries have a well-formed OCI API root. Signed-off-by: Rahul Ganesh <rahulgab@amazon.com>
bcd55c6 to
bd4a7c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
#10212 introduced a regression while migrating the registry mirror config from config.toml (registry.mirrors endpoint format) to
hosts.tomlformat. When oci namespaces are configured, ToAPIEndpoints() prepends /v2/ to the namespace path in the host URL. In the old
config.tomlformat this was used as-is. Inhosts.tomlformat, containerd's parser auto-appends an additional /v2/ to the host path, causing a double /v2/ in requests:/v2/< namespace>/v2/<repo>/manifests/<tag>resulting in 404.Description of changes:
Add
override_path = trueto namespacedhosts.tomlentries. This instructs containerd to use the host path as is without auto-appending /v2/. The base mirror entry (no path) does not have this flag set so containerd correctly adds /v2/ for direct repo references.Testing (if applicable):
Pre-fix (setup a test ns rahul-tst in our CI registry and validate the image pull URIs from the node):
Hosts.toml:
Image pull logs:
May 08 23:02:02 containerd[1404]: level=debug msg="fetch response received" response.status="404 Not Found" url="https://10.80.148.51:443/v2/rahul-test/v2/eks/cilium/cilium/manifests/v1.19.1-0?ns=public.ecr.aws"Post-fix:
Hosts.toml:
response.status="200 OK" content-type=application/vnd.oci.image.manifest.v1+json url="https://10.80.148.51:443/v2/rahul-test/eks/cilium/cilium/manifests/v1.19.1-0?ns=public.ecr.aws"Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.