Documentation
¶
Index ¶
- Constants
- type BundleFile
- type BundleStats
- type ComponentStats
- type ImageLayouts
- type ModuleImageLayout
- type ModuleRelease
- type ModuleStat
- type ModulesStats
- type PackageStat
- type PackagesStats
- type PullService
- type PullServiceOptions
- type PullSummary
- type PushService
- type PushServiceOptions
- type SecurityStats
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 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 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
// 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
// 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
// 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>/
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) 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 {
// BundleDir is the directory containing the bundle to push
BundleDir string
// WorkingDir is the temporary directory for unpacking bundles
WorkingDir string
}
PushServiceOptions contains configuration options for PushService
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.
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: |