platform

package
v0.30.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSomeChannelsFailed = errors.New("some channels failed to fetch")

Functions

This section is empty.

Types

type ComponentStats added in v0.30.20

type ComponentStats struct {
	Attempted bool
	Images    int
	// Versions are the resolved Deckhouse release versions to mirror (e.g.
	// ["v1.69.0"]); Channels are the release channels mapped to them. Both are
	// resolved by findTagsToMirror before any download, so they are populated in
	// dry-run as well.
	Versions []string
	Channels []string
}

ComponentStats is the platform phase's image accounting, mapped into the top-level summary by the pull orchestrator.

type ConcurrentWorker

type ConcurrentWorker[T, R any] struct {
	// contains filtered or unexported fields
}

func NewConcurrentWorker

func NewConcurrentWorker[T, R any](workersCount int) *ConcurrentWorker[T, R]

func (*ConcurrentWorker[T, R]) Do

func (cw *ConcurrentWorker[T, R]) Do(inputs []T, handler func(input T) (R, error), resultHandler func(item R) error) error

type ImageDownloadList added in v0.22.4

type ImageDownloadList struct {
	Deckhouse                  map[string]*puller.ImageMeta
	DeckhouseExtra             map[string]*puller.ImageMeta
	DeckhouseInstall           map[string]*puller.ImageMeta
	DeckhouseInstallStandalone map[string]*puller.ImageMeta
	DeckhouseReleaseChannel    map[string]*puller.ImageMeta
	// contains filtered or unexported fields
}

func NewImageDownloadList added in v0.22.4

func NewImageDownloadList(rootURL string) *ImageDownloadList

func (*ImageDownloadList) FillDeckhouseImages added in v0.22.4

func (l *ImageDownloadList) FillDeckhouseImages(deckhouseVersions []string)

func (*ImageDownloadList) FillForChannels added in v0.28.2

func (l *ImageDownloadList) FillForChannels(channels []string)

FillForChannels enqueues only release-channel:<channel> aliases (e.g. release-channel:stable). The main Deckhouse and Install repositories are intentionally left out: channel names like "alpha", "stable" or "lts" are just aliases for the corresponding version tag, so pulling <root>:<channel> in addition to <root>:<vX.Y.Z> would duplicate work in the best case and fail in the worst case — e.g. when re-pulling from a registry that received a `d8 mirror push` of a tag-based bundle (release-channel carries every alias propagated by pullDeckhousePlatform, but the main repo only carries version tags). Keeping channel aliases scoped to the release-channel layout removes that whole class of inconsistency between source and intermediate registries.

type ImageLayouts

type ImageLayouts struct {
	Deckhouse                  *regimage.ImageLayout
	DeckhouseInstall           *regimage.ImageLayout
	DeckhouseInstallStandalone *regimage.ImageLayout
	DeckhouseReleaseChannel    *regimage.ImageLayout
	// contains filtered or unexported fields
}

func NewImageLayouts

func NewImageLayouts(rootFolder string) *ImageLayouts

func (*ImageLayouts) AsList

func (l *ImageLayouts) AsList() []layout.Path

AsList returns the layout.Path of every defined sub-layout. Nil sub-layouts (for example, those never created in dry-run) are skipped.

type Options added in v0.24.3

type Options struct {
	// SinceVersion specifies the minimum version to start mirroring from (optional)
	SinceVersion *semver.Version
	// IncludeConstraint narrows platform release discovery to a user-supplied
	// semver constraint expression, mirroring the per-module constraint syntax
	// accepted by --include-module. When set it replaces the default discovery
	// window (rock-solid..alpha) — only registry tags matching the constraint
	// are pulled, latest-patch-per-(major, minor) collapsing applies and
	// release channels pointing outside the constraint are filtered out.
	//
	// IncludeConstraint is mutually exclusive with TargetTag: pinning one tag
	// and selecting a range simultaneously is contradictory and the CLI
	// rejects that combination before reaching this layer.
	IncludeConstraint modules.VersionConstraint
	// TargetTag specifies a specific tag to mirror instead of determining versions automatically
	// it can be:
	// semver f.e. vX.Y.Z
	// channel f.e. alpha/beta/stable
	// any other tag
	TargetTag 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
	// IgnoreSuspend allows mirroring even if release channels are suspended
	IgnoreSuspend bool
	// SkipVexImages allows skipping VEX images
	SkipVexImages bool
	// Timeout is the timeout for the platform access check
	Timeout time.Duration
	// DryRun prints the pull plan without downloading any image blobs
	DryRun bool
	// ProxyRegistry replaces catalog-based release discovery (ListTags
	// of the deckhouse release-channel repo) with a sequential probe of
	// individual version tags derived from IncludeConstraint. It exists
	// for proxy/caching registries that do not implement the registry
	// catalog API but DO serve manifests for tags they cache.
	//
	// The CLI requires IncludeConstraint when ProxyRegistry is set so
	// the probe has a defined starting point — without a lower bound
	// from the user the probe would have to start from 0.0.0 and would
	// never find anything.
	ProxyRegistry bool
}

Options contains configuration options for the platform service

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(
	registryService *registryservice.Service,
	workingDir string,
	options *Options,
	logger *dkplog.Logger,
	userLogger *log.SLogger,
) *Service

func (*Service) ExtractImageDigestsFromDeckhouseInstallerNew

func (svc *Service) ExtractImageDigestsFromDeckhouseInstallerNew(
	tag string,
	prevDigests map[string]struct{},
) (map[string]*puller.ImageMeta, error)

func (*Service) FindVexImage

func (svc *Service) FindVexImage(
	digest string,
) (string, error)

func (*Service) PullPlatform

func (svc *Service) PullPlatform(ctx context.Context) error

PullPlatform pulls the Deckhouse platform images and metadata It validates access to the registry, determines which versions to mirror, and prepares the image layouts for mirroring

func (*Service) Stats added in v0.30.20

func (svc *Service) Stats() ComponentStats

Stats returns image accounting for the platform phase. In dry-run it reports planned counts from the download list; otherwise it reports the actual number of manifests pulled into the OCI layouts, captured before packing (see Service.pulledImages).

type VersionsToMirrorResult added in v0.28.2

type VersionsToMirrorResult struct {
	// Versions contains semver versions to mirror
	Versions []semver.Version
	// Channels contains release channels to mirror
	Channels []string
	// CustomTags contains custom tags (non-semver, non-channel tags) to mirror
	CustomTags []string
}

VersionsToMirrorResult contains the result of versionsToMirror operation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL