Skip to content

soci-snapshotter: render registry mirrors as resolver hosts - #1061

Open
komapa wants to merge 1 commit into
bottlerocket-os:developfrom
komapa:soci-resolver-mirrors
Open

komapa wants to merge 1 commit into
bottlerocket-os:developfrom
komapa:soci-resolver-mirrors

Conversation

@komapa

@komapa komapa commented Sep 24, 2026

Copy link
Copy Markdown

Issue number:

Closes bottlerocket-os/bottlerocket#4949

Description of changes:

packages/soci-snapshotter/soci-config-toml rendered settings.container-registry.mirrors as:

[plugins."io.containerd.grpc.v1.cri".registry.mirrors."<registry>"]
endpoint = [...]

Only the SOCI containerd plugin reads that section (service/plugin/plugin.go). Bottlerocket runs the standalone soci-snapshotter-grpc daemon, which reads mirrors only from [resolver.host."<registry>".mirrors] and ignores unknown keys, so configured mirrors were never used by SOCI. With snapshotter = "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:

[[resolver.host."<registry>".mirrors]]
host = "<endpoint>"

and drops the now-unused join_array helper from the template requirements.

Compatibility: with SOCI 0.16, parallel pull still does not fetch layers from mirrors, and "*" and http:// 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:

  • Rendered the template with schnauzer (render_template_str + FakeImporter) for mirrors "*" and an ECR registry with two endpoints; output:
    [[resolver.host."*".mirrors]]
    host = "http://10.0.0.1:30031"
    [[resolver.host."123456789012.dkr.ecr.us-east-1.amazonaws.com".mirrors]]
    host = "http://10.0.0.1:30031"
    [[resolver.host."123456789012.dkr.ecr.us-east-1.amazonaws.com".mirrors]]
    host = "https://mirror.example.com"
  • Loaded that file with SOCI's config.NewConfigFromToml on the companion SOCI branch: an ECR image resolves to http://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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SOCI snapshotter ignores settings.container-registry.mirrors

1 participant