[deckhouse-cli] add --include-platform flag for platform release range mirroring#362
Merged
Conversation
Signed-off-by: Pavel Okhlopkov <[email protected]>
Signed-off-by: Pavel Okhlopkov <[email protected]>
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
--include-platformtod8 mirror pull. It accepts the same semver-constraint syntax that--include-moduleuses for module version pinning, letting users download a bounded window of platform releases in a single command without having to run separate pulls.Typical use-case: incremental air-gap update from Deckhouse v1.63 to v1.71, where the operator wants to download only the v1.64–v1.68 delta first:
Changes
New
--include-platformflag (flags.go,validation.go,pull.go)--include-platformaccepts any constraint expression valid for--include-module's version part: semver ranges (>=1.64 <=1.68), tilde/caret shorthands (~1.65.0,^1.65.0), bare version strings (1.65.0→ implicit caret), and exact-tag pins (=v1.65.3,=v1.65.3+stable).--deckhouse-tagand--since-versionat both the cobra and validation levels. Clear error messages guide the user when a forbidden combination is used.PlatformConstraint modules.VersionConstraintthreaded throughPullServiceOptions→platform.Options.Platform service constraint application (
platform.go)Exact-tag constraints (
=vX.Y.Z) are handled by synthesizingoptions.TargetTagat the top ofPullPlatform, so they reuse the already-tested--deckhouse-tagcode path for registry validation, channel propagation, and dry-run output verbatim.Semver constraints (
>=X <=Y,~X,^X, …) introduce a dedicated expansion path inexpandVersionRange:ReleaseChannels().ListTags.parseTagsMatchingConstraint.filterOnlyLatestPatchescollapses multiple patches in the same(major, minor)to the newest — matching how the default full-discovery path behaves.restoreInclusiveAnchorsre-adds versions that were explicitly named with>=/<=in the user's expression but were dropped by the latest-patch filter (the user named them by hand; silently dropping them would override an explicit choice).--since-versionis still honoured as an additional lower clamp when set alongside the constraint.versionsToMirrorviafilterChannelsByConstraint, so the bundle never references tags that were not downloaded.modules.ParseVersionConstraintexport (filter.go)The constraint parser that
NewFilteralready uses internally is now exported asParseVersionConstraint. This makes the platform path a consumer of the same parser instead of duplicating the dialect, ensuring both flags speak exactly the same constraint language.