Skip to content

[deckhouse-cli] Update the description of mirror pull flags#411

Open
VaLosev wants to merge 3 commits into
mainfrom
chore/update-description-flags-mirror-pull
Open

[deckhouse-cli] Update the description of mirror pull flags#411
VaLosev wants to merge 3 commits into
mainfrom
chore/update-description-flags-mirror-pull

Conversation

@VaLosev

@VaLosev VaLosev commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Currently, running the d8 mirror pull command with the --include-module flag may result in an error due to redirection with the ">" symbol.

d8 mirror pull --license='<LICENSE_KEY>' --source=registry.deckhouse.ru/deckhouse/ee  --no-platform  --no-installer -i console@>=1.43.2 ./console
Error executing command: pull failed: Prepare module filter: empty constraint

To avoid this issue, I've highlighted in the flag descriptions that the module version and its restrictions should be written in quotation marks.

d8 mirror pull \
--license='<LICENSE_KEY>' \
--no-platform --no-security-db \
--include-module console@">=1.43.2" \
./console

Added the DiagnoseConstraintParseError function to report an error when output is redirected instead of being passed to d8.
This function is triggered when both signals are present:

  1. The error message contains an "empty constraint" (the exact text that modules.NewFilter / modules.ParseVersionConstraint produces when there is no constraint).
  2. At least one raw flag value ends in @ after whitespace removal—a clear sign that the shell ate the >=… part as a redirection target.
d8 mirror pull --license='<LICENSE_KEY>' --source=registry.deckhouse.ru/deckhouse/ee  --no-platform  --no-installer -i console@>=1.43.2 ./console'

error: Invalid version constraint (possible shell redirection)
  ╰─▶ empty constraint

  * The shell interpreted '>' as output redirection instead of passing it to d8.
The constraint part after '@' was never received — perhaps you forgot to quote the flag value?
    -> Wrap the constraint in double quotes: --include-module "module-name@>=1.43.2"
    -> Example: d8 mirror pull --license='****' --include-module console@">=1.43.2" ./console

The parseAndValidateVersionFlags, createModuleFilter, and createPackageFilter functions have been updated to call this check, and tests have been added.

@VaLosev VaLosev self-assigned this Jul 21, 2026
@VaLosev
VaLosev requested a review from ldmonster as a code owner July 21, 2026 09:55
VaLosev added 2 commits July 24, 2026 18:25
Signed-off-by: Valery Losev <valery.losev@flant.com>
Signed-off-by: Valery Losev <valery.losev@flant.com>
@VaLosev
VaLosev force-pushed the chore/update-description-flags-mirror-pull branch from 387dd55 to 1d75b8f Compare July 24, 2026 14:31
Signed-off-by: Valery Losev <valery.losev@flant.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.

1 participant