Conversation
The template wrote settings.container-registry.mirrors to the SOCI config as [plugins."io.containerd.grpc.v1.cri".registry.mirrors]. Only the SOCI containerd plugin reads that section; the standalone soci-snapshotter-grpc daemon that Bottlerocket runs ignores it, so SOCI never used the configured mirrors. Render each mirror endpoint as [[resolver.host."<registry>".mirrors]], which is the section the standalone daemon reads. Signed-off-by: Kiril Angov <kangov@seatgeek.com>
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 number:
Closes bottlerocket-os/bottlerocket#4949
Description of changes:
packages/soci-snapshotter/soci-config-tomlrenderedsettings.container-registry.mirrorsas:Only the SOCI containerd plugin reads that section (
service/plugin/plugin.go). Bottlerocket runs the standalonesoci-snapshotter-grpcdaemon, which reads mirrors only from[resolver.host."<registry>".mirrors]and ignores unknown keys, so configured mirrors were never used by SOCI. Withsnapshotter = "soci", containerd resolves manifests through the mirror, but SOCI fetches all layers from the upstream registry.This change renders each endpoint as a resolver host mirror:
and drops the now-unused
join_arrayhelper from the template requirements.Compatibility: with SOCI 0.16, parallel pull still does not fetch layers from mirrors, and
"*"andhttp://mirror hosts are not handled; companion PRs awslabs/soci-snapshotter#2095 (mirrors in parallel pull,"*", URL schemes) and awslabs/soci-snapshotter#2096 (distribution source labels) address that. Until SOCI is updated, the rendered mirrors have no effect on pulls, which matches today's behavior.Testing done:
render_template_str+FakeImporter) for mirrors"*"and an ECR registry with two endpoints; output:config.NewConfigFromTomlon the companion SOCI branch: an ECR image resolves tohttp://10.0.0.1:30031,https://mirror.example.com, then the ECR endpoint.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.