Skip to content

[deckhouse-cli] Fix changelog.yaml doesnt exist#315

Merged
ldmonster merged 9 commits intomainfrom
fix/changelog-doesnt-exist
Apr 2, 2026
Merged

[deckhouse-cli] Fix changelog.yaml doesnt exist#315
ldmonster merged 9 commits intomainfrom
fix/changelog-doesnt-exist

Conversation

@Glitchy-Sheep
Copy link
Copy Markdown
Contributor

@Glitchy-Sheep Glitchy-Sheep commented Mar 31, 2026

Summary

d8 mirror pull without --deckhouse-tag "fails to generate deckhousereleases.yaml".
But it exists in the image itself (on release channel).

INFO   Generating DeckhouseRelease manifests
WARN   generate DeckhouseRelease manifests: Build manifest for version "v1.74.15":
       Extract changelog from release image: changelog.yaml: file does not exist

Additionally, every run produces 5 misleading warnings for install-standalone:

INFO  [1 / 6] Pulling registry.deckhouse.ru/deckhouse/install-standalone:beta
WARN  ⚠️ Not found in registry, skipping pull
INFO  [2 / 6] Pulling registry.deckhouse.ru/deckhouse/install-standalone:early-access
WARN  ⚠️ Not found in registry, skipping pull
INFO  [3 / 6] Pulling registry.deckhouse.ru/deckhouse/install-standalone:stable
WARN  ⚠️ Not found in registry, skipping pull
INFO  [4 / 6] Pulling registry.deckhouse.ru/deckhouse/install-standalone:rock-solid
WARN  ⚠️ Not found in registry, skipping pull
INFO  [5 / 6] Pulling registry.deckhouse.ru/deckhouse/install-standalone:alpha
WARN  ⚠️ Not found in registry, skipping pull

These look like errors but are harmless - install-standalone registry simply has no channel tags (only versioned like v1.74.15):

2026-04-01 AT 00 40@2x

The warnings confuse users who cannot tell if something is actually broken.

Problems & Solutions

1. Wrong OCI layout in manifest generation

Problem: platform.go:698 reads release-channel images from svc.layout.Deckhouse (core images) instead of svc.layout.DeckhouseReleaseChannel (where changelog.yaml actually lives).

Solution: Pass svc.layout.DeckhouseReleaseChannel.

2. Premature gzip reader close in file extraction

Problem: extract_file.go calls decompressedLayer.Close() on filename mismatch, then continue tries to read the next tar entry from a closed reader. The whole layer is skipped after the first non-matching file.

Solution: Remove Close() from the mismatch branch.

3. Missing error handling after GetImage

Problem: deckhouse_releases.go printed GetImage() error via fmt.Printf and continued with nil image, causing panic.

Solution: Log via svc.userLogger.Warnf and continue to the next version (skip failed image, do not interrupt pull).

4. False warnings for install-standalone

Problem: FillForChannels() adds channel tags (alpha, beta, stable...) for install-standalone, but this registry only has versioned tags. Confirmed via crane ls.

Solution: Skip channel tags for install-standalone in FillForChannels().

Refactoring

  • Removed dead GenerateDeckhouseReleaseManifestsForVersions function and its test-only helper
  • Moved internal/mirror/manifests/deckhouse_releases.go into internal/mirror/platform/ (the only consumer), deleted the now-empty manifests package
  • Renamed GenerateDeckhouseReleaseManifestsForVersionsNew to writeDeckhouseReleaseManifests (unexported, dropped New suffix)
  • Made it a method on *Service to use svc.userLogger instead of fmt.Printf
  • Added unit tests for generateDeckhouseRelease and extractReleaseInfoForDeckhouseRelease

Before / After

d8 mirror pull /tmp/test \
  --source registry.deckhouse.ru/deckhouse/ce \
  --license <TOKEN> \
  --since-version v1.74.0 \
  --no-modules --no-security-db

Before:

INFO  [1 / 6] Pulling registry.deckhouse.ru/deckhouse/install-standalone:beta
WARN  ⚠️ Not found in registry, skipping pull
INFO  [2 / 6] Pulling registry.deckhouse.ru/deckhouse/install-standalone:early-access
WARN  ⚠️ Not found in registry, skipping pull
...                                                          (x5 false warnings)
INFO   Generating DeckhouseRelease manifests
WARN   generate DeckhouseRelease manifests: Build manifest for version "v1.74.15":
       Extract changelog from release image: changelog.yaml: file does not exist
  • deckhousereleases.yaml missing from output
  • 5 confusing warnings for install-standalone on every run

After:

INFO  [1 / 1] Pulling registry.deckhouse.ru/deckhouse/install-standalone:v1.74.15
INFO   Generating DeckhouseRelease manifests
INFO   Searching for Deckhouse built-in modules digests
  • deckhousereleases.yaml generated correctly
  • No false warnings

- changelog.yaml exists only at release images

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
If it's supposed to be that way, there should be break, not continue

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- Prevents nil image from reaching extractReleaseInfoForDeckhouseRelease, which would panic
- Error propagates to the caller where it is logged as a warning without interrupting the pull

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
…xtra warnings

- The install-standalone registry has no channel tags (alpha, beta, etc.), only versioned ones
- Eliminates misleading "Not found in registry, skipping pull" warnings during mirror pull for standalone installer

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@Glitchy-Sheep Glitchy-Sheep self-assigned this Mar 31, 2026
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@ldmonster ldmonster merged commit 4bad6e9 into main Apr 2, 2026
5 checks passed
@ldmonster ldmonster deleted the fix/changelog-doesnt-exist branch April 2, 2026 14:58
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.

2 participants