[deckhouse-cli] add proxy registry handle#365
Merged
Conversation
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@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
--proxy-registryflag tod8 mirror pullfor pulling Deckhouse bundles from proxy/caching registries that serve individual manifests fine but refuse the registry catalog API (ListTags). Without this flag those registries return an empty tag list and the resulting bundle is empty even when the cache already holds the desired releases.Problem
The default discovery flow calls
ListTagson three repository paths to find versions to mirror:release-channelrepo — to enumerate platform release tags.A caching/transparent proxy registry typically rejects all three with an empty response or a
404. Any attempt to pull from such a registry with the current code produces an empty bundle.Solution
New flag
--proxy-registryreplaces the threeListTagscalls with a forward-probe walk over semver tags:--include-platform/--include-module@<constraint>.HEADrequest (CheckImageExists) per candidate.(M, m+1, 0)and probes once; if that also fails, jumps to the next major(M+1, 0, 0); if that fails too, terminates.--include-modulewhitelist — the "list what modules exist" catalog call is skipped entirely.Validation ensures sane flag combinations:
--include-platformwhen platform is being pulled (omit with--no-platform).--include-module <name>@<constraint>(with explicit version) for every module; bare--include-module foois rejected since it would start probing fromv0.0.0.--deckhouse-tag(single-tag pulls don't need a probe) and--since-version(no upper bound → probe can't terminate).--exclude-module,--no-platform,--no-modules,--dry-runare all honoured.Changed files
modules/constraints.goSemanticVersionConstraint.LowerBound()— extracts the lowest semver literal from a constraint string; used as the probe's seedmodules/probe.goProbeAvailableVersionsfunction — generic semver forward-probe walk with a pluggableProbeCheckerfunctionmodules/filter.goFilter.IsWhitelist(),Filter.ModuleNames()— helpers for the proxy-mode module discovery pathmodules/modules.godiscoverModuleNames,listTagsIfConstrained,probeModuleTags,validateModulesAccess— proxy-aware branchesplatform/platform.godiscoverConstrainedPlatformVersions,releaseTagExists— proxy-aware branch for--include-platformdiscoverypull.goProxyRegistryoption throughPullServiceOptions→platform.Options/modules.Optionscmd/pull/flags/flags.go--proxy-registryflag declarationcmd/pull/pull.go--deckhouse-tag/--since-version; passes flag to service optionscmd/pull/validation.govalidateProxyRegistryFlagPROXY-REGISTRY.mdREADME.MDPROXY-REGISTRY.md