[deckhouse-cli] Add plugin mirroring to d8 mirror pull and push - #445
Draft
Glitchy-Sheep wants to merge 12 commits into
Draft
[deckhouse-cli] Add plugin mirroring to d8 mirror pull and push#445Glitchy-Sheep wants to merge 12 commits into
Glitchy-Sheep wants to merge 12 commits into
Conversation
- `PluginsService` lists plugin names from the catalog path, `Plugin(name)` scopes to one plugin repo with its version tags. - `ContractAnnotation` reads the base64 contract from the manifest: index annotation first, first child as fallback. - The catalog hangs off the bare registry root, outside the edition segment - same asymmetry as the installer, pinned by tests. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- `AddIndex` writes a whole image index into the layout: platform children, their descriptors, and index annotations stay as published. - Same (tag, digest) idempotency guard as `AddImage`, so retried pulls do not duplicate descriptors. - Needed for CLI plugins: their images are multi-platform and flattening to one platform would lose the rest. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- `pushManifest` picks the push call by descriptor media type: `PushIndex` for a nested index, `PushImage` for a single image. - Before, push failed on any layout with an index: `index.Image()` rejects index media types. - CLI plugin images are such indexes: platform children and the contract annotation must reach the target registry whole. - Round-trip test against an in-memory registry: index digest, both platform children, and the contract annotation survive the push. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- `Catalog` reads the plugins registry: names from the directory-as-tags index, stable semver versions newest first, contracts decoded from the manifest annotation. - Results are memoized per pull: one tags listing per plugin, one manifest fetch per version. - `ErrInvalidContract` marks broken published contracts, so the resolver can skip that version; transport errors stay plain and fail the pull. - Resolver input/output types: typed module versions in, selected plugin versions with provenance out. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- For each bundled version of a mirrored module, the newest plugin version the bundle satisfies is picked; picks are deduplicated. - Mandatory plugin dependencies resolve recursively: shared versions are reused, disjoint constraints get two versions, cycles and depth are guarded. - A plugin with no compatible version is skipped with the reason recorded; an unmet `--include-plugin` fails the pull. - Module and Deckhouse constraints go through `requirements.NormalizedForConstraint` (now exported), so mirror and install compare versions the same way. - Exact pins bypass the stable-version list, so pre-releases stay reachable. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- `PullPlugins` resolves plugin versions for the bundle, pulls them, and packs one `plugin-<name>.tar` per plugin. - Multi-platform indexes are pulled whole: children fetched by digest, so platform binaries and the contract annotation stay as published. - Tars carry the `deckhouse-cli/plugins/<name>` prefix - the path mirror push uploads verbatim and registry-packages-proxy serves. - A registry without a plugins catalog skips auto-selection quietly; dry-run prints the plan and fills stats without downloads. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- The plugins phase runs last: it resolves against the module and platform versions the earlier phases actually selected. - New `--include-plugin name[@constraint]` flag adds plugins on top of the automatic selection; with `--proxy-registry` an exact pin is required. - `PullSummary.Plugins` carries per-version provenance, skips, and advisories for the summary renderer. - Dependencies on built-in d8 commands (`delivery-kit`, `package`) are never mirrored. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- `createPluginsIndex` tags the deckhouse-cli/plugins path with one tag per plugin, so `ListTags` discovery works on the target registry. - The same directory-as-tags convention modules and packages use; matches what registry-bundle serves for bundle-backed registries. - `PushSummary.Plugins` counts pushed plugin repositories; the push summary prints a Plugins line. - Plugin layouts are not touched by `--modules-path-suffix`: their registry path is fixed, pinned by a test. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- The Plugins line shows the count with a provenance breakdown: how many serve modules, how many are dependencies, how many were explicit. - Verbose mode draws the tree: plugins grouped by the module they serve, dependencies nested under their dependents. - Skipped plugins with their reasons are always visible - losing a plugin in an air-gapped bundle should not hide behind a flag. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- Plugin Mirroring section in the mirror README: selection rules, registry layout, what mirror checks vs what install checks. - Air-gapped flow in docs/plugins.md: pull -> push -> `d8 plugins install` through the proxy. - Proxy-registry doc: auto-selection needs a catalog, so only exact `--include-plugin` pins work there. - The push layout doc-tree gains the deckhouse-cli/plugins branch. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- The e2e suite runs the whole `PullService.Pull`: module versions from release channels reach the plugin resolver and pick compatible plugin versions. - Checks summary reasons for picked and skipped plugins, the `deckhouse` constraint, exact pins and the `--only-extra-images` skip. - A pull-to-push roundtrip carries plugin tars into a target registry and checks the plugin name index. - `--modules-path-suffix` moves modules only - the roundtrip checks that plugins stay put. - Test stubs now carry a pullable module and a plugin catalog: the plugins phase is no longer a no-op in orchestration and command-level tests. Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
- unparam: every call passed stubModuleVersion, so the helper now reads the constant itself. 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
d8 mirrornow carries CLI plugins into air-gapped installs.Pull picks the plugin versions the mirrored modules need, packs each plugin into its own tar, and push publishes them so
d8inside the closed network can install them.How it works
deckhouse-cli/plugins/<name>, next to the installer, outside the edition path.--include-plugin.Before / After
Before:
d8 mirrorcarried the platform, modules, packages and security databases; plugins could not reach closed networks at all.After: the bundle also holds
plugin-<name>.tarfor every plugin the modules need; push uploads them to the same paths and adds a name tag to the catalog.Tests
TestPullE2E_*(9 tests): the wholePullService.Pullon a fake registry, plus a pull-to-push roundtrip into a target registry.Puller.Executewith the registry stub produces plugin tars next to module tars; dry-run writes nothing.Notes
--include-pluginaccepts ranges and exact pins (name@=vX.Y.Z); only pins reach pre-releases. With--proxy-registry, only exact pins are allowed.