Skip to content

[deckhouse-cli] Fix mirror pull to use edition-scope during pull#336

Open
Glitchy-Sheep wants to merge 1 commit intomainfrom
fix/d8-mirror-pull-misleading-logs
Open

[deckhouse-cli] Fix mirror pull to use edition-scope during pull#336
Glitchy-Sheep wants to merge 1 commit intomainfrom
fix/d8-mirror-pull-misleading-logs

Conversation

@Glitchy-Sheep
Copy link
Copy Markdown
Contributor

Problem

For edition sources (registry.deckhouse.io/deckhouse/fe), d8 mirror pull generated 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.

2026-04-20 AT 18 34@2x

The unscoped paths don't actually exist in the registry - the buggy refs would fail on pull (verified with crane manifest):

2026-04-20 AT 18 45@2x

Fix

  • modules, platform, and security now resolve refs from the edition-scoped root via registryService.DeckhouseService().GetRoot().

  • installer keeps 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.name annotations in OCI index.json change in lockstep:

Area Before After
release-channel registry.deckhouse.io/deckhouse/release-channel:... registry.deckhouse.io/deckhouse/fe/release-channel:...
install(-standalone) registry.deckhouse.io/deckhouse/install[-standalone]:... registry.deckhouse.io/deckhouse/fe/install[-standalone]:...
security (trivy-*) registry.deckhouse.io/deckhouse/security/trivy-*:... registry.deckhouse.io/deckhouse/fe/security/trivy-*:...
platform image registry.deckhouse.io/deckhouse:v1.69.0 registry.deckhouse.io/deckhouse/fe:v1.69.0

Archive Validation

Diffed a real before/after pull:

  • platform.tar, installer.tar, security.tar all present with valid OCI layouts.
  • Files that differ:
    • platform.tar: index.json, install/index.json, install-standalone/index.json, release-channel/index.json
    • security.tar: security/trivy-{db,bdu,java-db,checks}/index.json + their blobs/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.go
  • internal/mirror/modules/root_scope_test.go
  • internal/mirror/platform/root_scope_test.go
  • internal/mirror/security/root_scope_test.go

… + 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>
@Glitchy-Sheep Glitchy-Sheep requested a review from ipaqsa April 20, 2026 15:53
@Glitchy-Sheep Glitchy-Sheep self-assigned this Apr 20, 2026
@Glitchy-Sheep Glitchy-Sheep added the bug Something isn't working label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant