[deckhouse-cli] Fix mirror pull to use edition-scope during pull#336
Open
Glitchy-Sheep wants to merge 1 commit intomainfrom
Open
[deckhouse-cli] Fix mirror pull to use edition-scope during pull#336Glitchy-Sheep wants to merge 1 commit intomainfrom
Glitchy-Sheep wants to merge 1 commit intomainfrom
Conversation
… + remove dead code - Security, platform, and modules pullers build image refs from the edition-scoped registry root, so logs and OCI `ref.name` annotations in pulled archives include the correct edition path (e.g. `/deckhouse/ee/security/trivy-db:2`). - Clarify docstrings on the registry service tree so it's clear how sub-services map to paths under the chosen base. - Drop unreachable helpers in modules layout (ModulesDownloadList.Module, FillModulesImages, FillForTag). Signed-off-by: Roman Berezkin <roman.berezkin@flant.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.
Problem
For edition sources (
registry.deckhouse.io/deckhouse/fe),d8 mirror pullgenerated part of its refs from the non-edition root (.../deckhouse/...) instead of the edition root (.../deckhouse/fe/...). Pull plans and OCI metadata ended up mixing scoped and unscoped paths.The unscoped paths don't actually exist in the registry - the buggy refs would fail on pull (verified with
crane manifest):Fix
modules,platform, andsecuritynow resolve refs from the edition-scoped root viaregistryService.DeckhouseService().GetRoot().installerkeeps its edition-independent root (by design).Service-layer comments clarified scoped vs unscoped roots.
Additionally removed some dead code and added more doc comments for clarity
Before / After
Three areas were affected. Refs (pull logs) and
org.opencontainers.image.ref.nameannotations in OCIindex.jsonchange in lockstep:registry.deckhouse.io/deckhouse/release-channel:...registry.deckhouse.io/deckhouse/fe/release-channel:...registry.deckhouse.io/deckhouse/install[-standalone]:...registry.deckhouse.io/deckhouse/fe/install[-standalone]:...registry.deckhouse.io/deckhouse/security/trivy-*:...registry.deckhouse.io/deckhouse/fe/security/trivy-*:...registry.deckhouse.io/deckhouse:v1.69.0registry.deckhouse.io/deckhouse/fe:v1.69.0Archive Validation
Diffed a real before/after pull:
platform.tar,installer.tar,security.tarall present with valid OCI layouts.platform.tar:index.json,install/index.json,install-standalone/index.json,release-channel/index.jsonsecurity.tar:security/trivy-{db,bdu,java-db,checks}/index.json+ theirblobs/sha256/*installer.tar: no differences (expected - installer root is edition-independent)Only target refs/annotations changed; layout structure and image selection logic are untouched.
Tests
Regression tests added for root scoping:
pkg/registry/service/service_root_test.gointernal/mirror/modules/root_scope_test.gointernal/mirror/platform/root_scope_test.gointernal/mirror/security/root_scope_test.go