[deckhouse-cli] fix sequential download when 0 major#412
Merged
Conversation
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
Glitchy-Sheep
approved these changes
Jul 22, 2026
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.
What
d8 mirror pullsilently skipped intermediate minor versions of0.xmodules when a bare (operator-less) version was passed to--include-module.For a module on the
0.xline:only
0.4.4(plus whatever the release channels currently point at, e.g.0.7.2) was pulled —0.5.*and0.6.*were dropped, leaving gaps that block Deckhouse's one-minor-at-a-time upgrades. Modules on>=1.0(console,gpu) were unaffected, which made the behaviour look random.Why
A bare version was expanded by prepending a caret (
0.4.0→^0.4.0).Masterminds/semverspecial-cases the0.xmajor line for caret:^1.52.0>=1.52.0 <2.0.01.x✅^0.4.0>=0.4.0 <0.5.00.4.xSo for a
0.xmodule the caret locked the minor, not the major, and every intermediate minor fell outside the constraint.>=1.0modules happened to work because there the caret locks the major.Fix
Bare versions are now expanded to an explicit range
>=X.Y.Z <(major+1).0.0, treating major0like any other major line:alb@0.4.0>=0.4.0 <1.0.00.xfrom 0.4 up ✅console@1.52.0>=1.52.0 <2.0.01.x(byte-identical to old caret)The synthesized
>=lower bound is deliberately not registered as an inclusive anchor — a bare version is not an explicit boundary, so the "latest-patch-per-minor" collapse still applies (preserves the issue #220 behaviour).--include-platformshares the same parser; since platform versions are always>=1.0, its behaviour is unchanged.Changes
internal/mirror/modules/constraints.go— newNewImplicitVersionConstraintthat builds the caret-free range and clears anchors.internal/mirror/modules/filter.go—parseVersionConstraintroutes bare versions through the new helper instead of prepending^; updatedParseVersionConstraintdoc.internal/mirror/cmd/pull/flags/flags.go— corrected the--include-module/--include-platformhelp (the old text claimed "implicit caret"), added a0.xexample and a shell-quoting note for>=/<=(the shell eats the>/<redirection metacharacters, so those operators must be quoted; the bare-version form needs no quoting).internal/mirror/modules/filter_test.go— regression testTestFilter_BareVersionConstraintcovering the0.xfix and confirming the1.xpath is unchanged.Behaviour change / compatibility
0.xmodules: bare version now spans the whole0.xline (the bug fix).>=1.0modules: no change — bare version resolves to the same set as before.^,~,>=,<=,=constraints are untouched. Users who still want the old "single 0.x minor" behaviour can passalb@~0.4.0.Testing
go test ./internal/mirror/modules/ ./internal/mirror/cmd/pull/— pass (new regression test + all existing caret/tilde/range/anchor cases green).go build ./internal/mirror/...andgo vet— clean.Reproduction / verification
Available
albversions:v0.4.2, v0.4.4, v0.5.3, v0.6.1, v0.7.2--include-module alb@0.4.00.4.4(+ channel snapshots)0.4.4, 0.5.3, 0.6.1, 0.7.2