Documentation
¶
Index ¶
- Constants
- type BundleFile
- type BundleStats
- type ComponentStats
- type ImageLayouts
- type ModuleImageLayout
- type ModuleRelease
- type ModuleStat
- type ModulesPathReport
- type ModulesStats
- type PackageStat
- type PackagesStats
- type PluginReason
- type PluginStat
- type PluginVersionStat
- type PluginsStats
- type PullService
- type PullServiceOptions
- type PullSummary
- type PushService
- type PushServiceOptions
- type PushSummary
- type SecurityStats
- type SkippedPluginStat
Constants ¶
const ( TmpMirrorFolderName = "mirror" TmpMirrorPullFolderName = "pull" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BundleFile ¶ added in v0.30.20
type BundleFile struct {
// Name is the logical artifact name, e.g. "module-foo.tar".
Name string
// Bytes is the total size across all chunks of the artifact.
Bytes int64
// Chunks is the number of .chunk files (0 for a single .tar artifact).
Chunks int
}
BundleFile is one logical bundle artifact (platform.tar, installer.tar, security.tar, module-<name>.tar), possibly spread over .NNNN.chunk files.
type BundleStats ¶ added in v0.30.20
type BundleStats struct {
Files []BundleFile
TotalBytes int64
}
BundleStats is the on-disk artifact accounting collected after packing.
type ComponentStats ¶ added in v0.30.20
type ComponentStats struct {
// Skipped is true when the category was disabled via a Skip* option.
Skipped bool
// Attempted is true when the phase ran, even if it produced zero images.
Attempted bool
// Images is the number of image manifests (planned or actual).
Images int
// Versions are the resolved release versions that will be (or were) pulled,
// e.g. ["v1.69.0"] or ["v1.71.7", "v1.72.3"]. Populated for the platform;
// available in dry-run too, since version selection happens before download.
Versions []string
// Channels is the set of release channels mapped to Versions (platform only).
Channels []string
}
ComponentStats is the per-category image accounting captured after a pull phase completes. The image count is "planned" in dry-run (download-list lengths) and "actual" in a real pull (OCI layout manifest counts).
type ImageLayouts ¶ added in v0.22.1
type ImageLayouts struct {
DeckhousePlatform *platform.ImageLayouts
TrivyDB layout.Path
TrivyDBImages map[string]struct{}
TrivyBDU layout.Path
TrivyBDUImages map[string]struct{}
TrivyJavaDB layout.Path
TrivyJavaDBImages map[string]struct{}
TrivyChecks layout.Path
TrivyChecksImages map[string]struct{}
Modules map[string]ModuleImageLayout
// contains filtered or unexported fields
}
func NewImageLayouts ¶ added in v0.22.1
func NewImageLayouts() *ImageLayouts
type ModuleImageLayout ¶ added in v0.22.1
type ModuleRelease ¶ added in v0.22.1
type ModuleRelease struct {
Version string
}
type ModuleStat ¶ added in v0.30.20
type ModuleStat struct {
Name string
Images int
// VEX is how many of Images are VEX attestations (a subset of Images).
VEX int
// Versions are the resolved module versions that will be (or were) pulled,
// e.g. ["v1.10.3", "v1.9.16"]. Available in dry-run too.
Versions []string
}
ModuleStat is one module's contribution to the pull.
type ModulesPathReport ¶ added in v0.33.5
type ModulesPathReport struct {
// Moved is true when the modules path differs from the standard "modules"
// segment (i.e. --modules-path-suffix took effect).
Moved bool
// Root is the registry base repo the modules path is rooted at: the edition
// root (pull) or the target repo (push), without the modules segment.
Root string
// Path is the full registry path modules were read from (pull) or written to
// (push).
Path string
// DefaultPath is the standard modules path, shown as a "default: <path>" hint
// next to a moved path.
DefaultPath string
}
ModulesPathReport describes where modules were mirrored, so the pull/push summary can warn when the path was moved off the standard layout via --modules-path-suffix. Only the modules path is configurable today, so it is the only component the summary tracks.
func BuildModulesPathReport ¶ added in v0.33.5
func BuildModulesPathReport(root, modulesPathSuffix string) ModulesPathReport
BuildModulesPathReport resolves the modules registry path for the summary.
root is the edition root (pull) or the target repo (push). modulesPathSuffix is the raw --modules-path-suffix value; it is normalized the same way as the real push/pull path so the summary matches where images actually go.
func (ModulesPathReport) Warning ¶ added in v0.33.5
func (m ModulesPathReport) Warning() string
Warning is the single-line form of the moved-modules-path warning, for the start of the pull/push log: it names the path modules go through and the standard path they would go through by default. Empty for a standard path.
The same warning closes the run as a multi-line block in the summary (see summaryui.WriteModulesPathWarning), where the module count is known.
type ModulesStats ¶ added in v0.30.20
type ModulesStats struct {
// Skipped is true when modules were disabled and OnlyExtraImages is off.
Skipped bool
// Attempted is true when the modules phase ran.
Attempted bool
// OnlyExtraImages reflects the --only-extra-images mode.
OnlyExtraImages bool
// Modules holds the per-module breakdown, sorted by name.
Modules []ModuleStat
// TotalImages is the sum of images across all modules.
TotalImages int
// TotalVEX is the number of VEX attestations across all modules, a subset of
// TotalImages.
TotalVEX int
}
ModulesStats aggregates per-module image accounting.
type PackageStat ¶ added in v0.30.20
type PackageStat struct {
Name string
Images int
// VEX is how many of Images are VEX attestations (a subset of Images).
VEX int
// Versions are the resolved package versions that will be (or were) pulled,
// e.g. ["v1.45.2", "v1.44.0"]. Available in dry-run too.
Versions []string
}
PackageStat is one package's contribution to the pull.
type PackagesStats ¶ added in v0.30.20
type PackagesStats struct {
// Skipped is true when packages were disabled and OnlyExtraImages is off.
Skipped bool
// Attempted is true when the packages phase ran.
Attempted bool
// OnlyExtraImages reflects the --only-extra-images mode.
OnlyExtraImages bool
// Packages holds the per-package breakdown, sorted by name.
Packages []PackageStat
// TotalImages is the sum of images across all packages.
TotalImages int
// TotalVEX is the number of VEX attestations across all packages, a subset of
// TotalImages.
TotalVEX int
}
PackagesStats aggregates per-package image accounting.
type PluginReason ¶ added in v0.33.8
PluginReason is one provenance edge of a pulled plugin version: why it is in the bundle. Kind is "module" (Subject = module name), "dependency" (Subject = "<dependent>@<version>"), or "explicit" (Subject = the flag).
type PluginStat ¶ added in v0.33.8
type PluginStat struct {
Name string
Images int
// Versions are the pulled versions, newest first. Available in dry-run too.
Versions []PluginVersionStat
}
PluginStat is one plugin's contribution to the pull.
type PluginVersionStat ¶ added in v0.33.8
type PluginVersionStat struct {
Version string
Reasons []PluginReason
}
PluginVersionStat is one pulled plugin version with its provenance.
type PluginsStats ¶ added in v0.33.8
type PluginsStats struct {
// Skipped is true when the phase did not run (--only-extra-images).
Skipped bool
// Attempted is true when the plugins phase ran.
Attempted bool
// Plugins holds the per-plugin breakdown, sorted by name.
Plugins []PluginStat
// SkippedPlugins are plugins the resolver dropped, with reasons.
SkippedPlugins []SkippedPluginStat
// Warnings are resolver advisories worth showing in the summary.
Warnings []string
// TotalImages is the sum of images across all plugins.
TotalImages int
}
PluginsStats aggregates the plugins phase accounting.
type PullService ¶ added in v0.22.1
type PullService struct {
// contains filtered or unexported fields
}
func NewPullService ¶ added in v0.22.1
func NewPullService( registryService *registryservice.Service, tmpDir string, targetTag string, options *PullServiceOptions, logger *dkplog.Logger, userLogger *log.SLogger, ) *PullService
func (*PullService) Pull ¶ added in v0.22.1
func (svc *PullService) Pull(ctx context.Context) (*PullSummary, error)
Pull downloads Deckhouse components from registry.
It returns a PullSummary describing what was pulled (or planned, in dry-run). The summary is assembled incrementally as each phase completes, and is returned even on error so that callers can render a partial summary after a graceful cancellation.
type PullServiceOptions ¶ added in v0.24.3
type PullServiceOptions struct {
// SkipPlatform skips pulling platform images
SkipPlatform bool
// SkipSecurity skips pulling security databases
SkipSecurity bool
// SkipModules skips pulling module images
SkipModules bool
// SkipPackages skips pulling package images
SkipPackages bool
// SkipInstaller skips pulling installer images
SkipInstaller bool
// InstallerTag is the tag for the installer image
InstallerTag string
// OnlyExtraImages pulls only extra images for modules (without main module images)
OnlyExtraImages bool
// IgnoreSuspend allows mirroring even if release channels are suspended
IgnoreSuspend bool
// PlatformConstraint selects platform releases by semver constraint
// (--include-platform). When non-nil it replaces the default
// rock-solid..alpha discovery window for the platform service. Exact-tag
// constraints are routed through TargetTag inside platform.PullPlatform.
PlatformConstraint modules.VersionConstraint
// ModuleFilter is the filter for module selection (whitelist/blacklist)
ModuleFilter *modules.Filter
// PackageFilter is the filter for package selection (whitelist/blacklist).
// Packages reuse the modules filter because selection logic is identical.
PackageFilter *modules.Filter
// PluginFilter carries --include-plugin entries (whitelist, additive to
// the module-driven plugin auto-selection). May be nil.
PluginFilter *modules.Filter
// PluginBuiltins are d8 built-in command names that satisfy a same-named
// plugin dependency by presence (never pulled).
PluginBuiltins []string
// BundleDir is the directory to store the bundle
BundleDir string
// BundleChunkSize is the max size of bundle chunks in bytes (0 = no chunking)
BundleChunkSize int64
// SkipVexImages allows skipping VEX images
SkipVexImages bool
// Timeout is the timeout for the pull operation
Timeout time.Duration
// DryRun prints the pull plan without downloading any image blobs
DryRun bool
// ProxyRegistry switches platform/module discovery from a single
// catalog ListTags call (which proxy registries typically return
// empty for) to a sequential probe of explicit version tags. The
// CLI guarantees that --include-platform and/or --include-module
// are supplied so the probe has a defined starting point.
ProxyRegistry bool
}
PullServiceOptions contains configuration options for PullService
type PullSummary ¶ added in v0.30.20
type PullSummary struct {
// DryRun reports whether this was a planning run with no downloads.
DryRun bool
// Cancelled marks a graceful interrupt (Ctrl+C); the summary reflects what
// completed before it.
Cancelled bool
// Failed marks a hard-error abort (e.g. retries exhausted, checksum failure).
// The summary still renders, in a FAILED state. A phase that never ran has a
// zero-valued stat and renders "not pulled". Mutually exclusive with Cancelled.
Failed bool
// Edition is the source edition (e.g. "ce", "ee"), parsed from the source
// registry path. Empty for a custom registry with no edition segment, in
// which case the summary omits the Edition line.
Edition string
// ModulesPath is where modules were read from in the source registry. The
// summary warns about it only when the path was moved off the default and
// modules were actually pulled. Filled by the CLI.
ModulesPath ModulesPathReport
// Elapsed is the wall-clock duration of the pull, filled by the CLI.
Elapsed time.Duration
Platform ComponentStats
Installer ComponentStats
Security SecurityStats
Modules ModulesStats
Packages PackagesStats
Plugins PluginsStats
// Bundle is populated by the CLI from the bundle directory (real pull only).
Bundle BundleStats
}
PullSummary is the complete end-of-pull accounting handed to the renderer.
type PushService ¶ added in v0.22.1
type PushService struct {
// contains filtered or unexported fields
}
PushService handles pushing OCI layouts to registry. It treats the layout structure as the source of truth - the relative path of each layout becomes the registry segment directly.
Expected layout structure (after unpack):
<root>/
├── index.json # Deckhouse main images
├── blobs/
├── install/ # Deckhouse Install
│ ├── index.json
│ └── blobs/
├── install-standalone/ # Deckhouse Standalone Install
├── release-channel/ # Deckhouse release channels
├── security/ # Security databases
│ ├── trivy-db/
│ ├── trivy-bdu/
│ ├── trivy-java-db/
│ └── trivy-checks/
├── modules/ # Modules
│ └── <module-name>/
│ ├── index.json
│ ├── release/
│ └── <extra-name>/
├── packages/ # Packages
│ └── <package-name>/
│ ├── index.json
│ ├── version/
│ └── <extra-name>/
└── deckhouse-cli/ # d8 CLI plugins
└── plugins/
└── <plugin-name>/
├── index.json
└── blobs/
func NewPushService ¶ added in v0.22.1
func NewPushService( client client.Client, options *PushServiceOptions, logger *dkplog.Logger, userLogger *log.SLogger, ) *PushService
NewPushService creates a new PushService
func (*PushService) Push ¶ added in v0.26.4
func (svc *PushService) Push(ctx context.Context) (*PushSummary, error)
Push uploads all OCI layouts from the bundle to the registry. It unpacks all packages into a unified directory and pushes each layout using its relative path as the registry segment.
The key principle: no path transformations. Whatever path the layout has in the unpacked directory becomes its path in the registry.
type PushServiceOptions ¶ added in v0.26.4
type PushServiceOptions struct {
// Packages is the list of tar/chunked package archive paths to push.
Packages []string
// WorkingDir is the temporary directory for unpacking bundles
WorkingDir string
// ModulesPathSuffix is the registry path suffix to push modules to,
// relative to the target repo. Empty value keeps the default "modules".
// Leading and trailing slashes are ignored.
ModulesPathSuffix string
}
PushServiceOptions contains configuration options for PushService
type PushSummary ¶ added in v0.33.5
type PushSummary struct {
// Cancelled marks a graceful interrupt (Ctrl+C); the summary reflects what
// completed before it.
Cancelled bool
// Failed marks a hard-error abort. The summary still renders, in a FAILED
// state. Mutually exclusive with Cancelled.
Failed bool
// ModulesPath is where modules were written in the target registry. The
// summary warns about it only when the path was moved off the default and
// modules were actually pushed. Filled by PushService.
ModulesPath ModulesPathReport
// Elapsed is the wall-clock duration of the push, filled by the CLI.
Elapsed time.Duration
// PlatformPushed is true when platform layouts were pushed: the root images,
// release channels, or the install / install-standalone installers.
PlatformPushed bool
// InstallerPushed is true when the standalone installer repo was pushed.
InstallerPushed bool
// SecurityDatabases is the number of security database layouts pushed.
SecurityDatabases int
// Modules is the number of module repositories pushed.
Modules int
// Plugins is the number of CLI plugin repositories pushed, counted from
// the plugins index step.
Plugins int
// Packages is the number of package repositories pushed.
Packages int
}
PushSummary is the end-of-push accounting handed to the renderer. Push has no per-image or version detail, so it reports which components the bundle carried and how many module/package repositories and security databases were pushed.
type SecurityStats ¶ added in v0.30.20
type SecurityStats struct {
// Skipped is true when --no-security-db was set.
Skipped bool
// Attempted is true when the security phase ran.
Attempted bool
// Available is false for editions without security databases (CE/BE/SE),
// where securityDatabasesAvailable() returned false.
Available bool
// Databases is the number of databases pulled (real pull) or enqueued
// (dry-run). At most AvailableDatabases.
Databases int
// AvailableDatabases is the size of the security database catalogue
// (trivy-db, trivy-bdu, trivy-java-db, trivy-checks).
AvailableDatabases int
}
SecurityStats specializes ComponentStats for the trivy security databases.
type SkippedPluginStat ¶ added in v0.33.8
SkippedPluginStat is a plugin the resolver considered and dropped, with the reason spelled out.
Directories
¶
| Path | Synopsis |
|---|---|
|
api
|
|
|
pull/errdetect
Package errdetect classifies registry errors for d8 mirror pull with pull-specific causes and solutions.
|
Package errdetect classifies registry errors for d8 mirror pull with pull-specific causes and solutions. |
|
push/errdetect
Package errdetect classifies registry errors for d8 mirror push with push-specific causes and solutions.
|
Package errdetect classifies registry errors for d8 mirror push with push-specific causes and solutions. |
|
Package errmatch provides error matchers for container registry responses.
|
Package errmatch provides error matchers for container registry responses. |
|
Package pack contains the atomic-write helper shared by every component that emits a tar artifact into the user's bundle directory (platform, installer, security, per-module).
|
Package pack contains the atomic-write helper shared by every component that emits a tar artifact into the user's bundle directory (platform, installer, security, per-module). |
|
Package packages mirrors Deckhouse "packages", which are structurally identical to modules but live under a different set of registry segments:
|
Package packages mirrors Deckhouse "packages", which are structurally identical to modules but live under a different set of registry segments: |
|
Package plugins mirrors d8 CLI plugins into the images bundle.
|
Package plugins mirrors d8 CLI plugins into the images bundle. |
|
Package summaryui holds the shared presentation primitives for the mirror pull and push summaries: the framed box, the accent colours, and the registry layout section.
|
Package summaryui holds the shared presentation primitives for the mirror pull and push summaries: the framed box, the accent colours, and the registry layout section. |