Open
Conversation
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
- Stream images_digests.json directly from remote registry using ExtractFileFromImage (layer-by-layer), avoiding full installer image download to disk - Skip OCI layout creation, release channel pulls, and standalone installer pulls in dry-run mode - none are needed for image list resolution - Separate dry-run logic into dedicated path (pullDeckhousePlatformDryRun) keeping the normal pull path free of conditional checks - Remove implicit VEX scanning from dry-run - (~319 unnecessary network calls) Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- Dry-run methods (pullDeckhousePlatformDryRun, extractImageDigestsFromRemote) live in platform_dryrun.go for clear separation from the normal pull path - Grouped dry-run output with per-category headers and sorted image refs 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>
Glitchy-Sheep
previously approved these changes
Apr 8, 2026
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.
Summary
Adds a
--dry-runflag tod8 mirror pullthat resolves versions, extracts image digests, and prints the complete list of images that would be downloaded — without actually pulling any blobs or writing bundle files. This enables fast validation of CLI flags, filters, and registry connectivity in seconds instead of the 30–60+ minutes a real pull takes.Motivation
d8 mirror pulldownloads tens of GBs of images. There was no way to quickly verify that flag combinations, module filters, and version resolution work correctly.--source,--license,--deckhouse-tag,--modules,--no-modules,--no-security-dbflags produce the expected image list before committing to a long download.Usage
Exit code 0 on success, non-zero on errors (invalid flags, registry unreachable, etc.). Bundle directory remains empty.
Changes
Flag registration & threading
internal/mirror/cmd/pull/flags/flags.goDryRun boolvariable +--dry-runflag registered inAddFlags()internal/mirror/cmd/pull/pull.goDryRun: pullflags.DryRunintoPullServiceOptions; skipcomputeGOSTDigestsandfinalCleanupwhen dry-runinternal/mirror/pull.goDryRun booltoPullServiceOptions; propagate to all 4 sub-serviceOptionsstructs inNewPullService()Service-level guards
Each service adds
DryRun boolto itsOptionsstruct and inserts a guard after version/image resolution but before blob download and bundle packing:internal/mirror/platform/platform.goimages_digests.json). SkipspullDeckhouseImages(the large blob download), skipsgenerateDeckhouseReleaseManifests, gracefully handles missingimages_digests.json(warn instead of error). Prints all resolved image refs (Deckhouse, ReleaseChannel, Install, InstallStandalone) then returns.internal/mirror/modules/modules.goPullImages). Prints per-module image list. Skips OCI layout post-processing (sort, aliases, packing).internal/mirror/security/security.goFillSecurityImages()to resolve image refs. Prints them and returns beforePullImages.internal/mirror/installer/installer.goFillInstallerImages()to resolve image refs. Prints them and returns beforepullInstaller.Key design decisions
Platform installer IS pulled to tmpDir even in dry-run. This is intentional —
images_digests.jsonis embedded inside the installer image and must be extracted to produce the complete image list. Only the main Deckhouse release blobs (~GBs) are skipped.No bundle output. The bundle directory is never written to in dry-run mode. GOST digest computation and final cleanup are skipped at the command level.
Graceful degradation. If
images_digests.jsonextraction fails in dry-run (e.g., stub registry), the service warns and continues rather than returning an error. The user still sees all version/channel refs that were resolved.Test execution
Documentation
docs/mirror-pull-dry-run.md— CLI usage, exit codes, unit & integration test instructions, internal call tree, temp file reference.