moduleloader

package
v1.76.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrModuleIsNotFound              = errors.New("module is not found")
	ErrConversionsDirectoryPathEmpty = errors.New("conversions directory path is empty")
)

Functions

This section is empty.

Types

type Installer added in v1.76.3

type Installer interface {
	SetClusterUUID(id string)
	GetInstalled() (map[string]struct{}, error)
	GetImageDigest(ctx context.Context, source *v1alpha1.ModuleSource, moduleName, version string) (string, error)
	Download(ctx context.Context, source *v1alpha1.ModuleSource, moduleName, version string) (string, error)
	Install(ctx context.Context, module, version, tempModulePath string) error
	Stage(ctx context.Context, module, version, tempModulePath string) error
	StageFromRegistry(ctx context.Context, source *v1alpha1.ModuleSource, module, version string) error
	Restore(ctx context.Context, source *v1alpha1.ModuleSource, module, version string) error
	IsEmbeddedPresent(module string) bool
	Uninstall(ctx context.Context, module string) error
}

Installer abstracts *installer.Installer so tests can inject a mock and assert which installation path a module took (Restore vs StageFromRegistry) without touching the registry or filesystem. It mirrors the public method set of *installer.Installer that the loader and its getter expose to other controllers.

type Loader

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

func New

func New(client client.Client, version, modulesDir, globalDir string, dc dependency.Container, exts extenders.IExtendersStack, embeddedPolicy *helpers.ModuleUpdatePolicySpecContainer, conversionsStore *conversion.ConversionsStore, logger *log.Logger) *Loader

func (*Loader) GetModuleByName

func (l *Loader) GetModuleByName(name string) (*moduletypes.Module, error)

func (*Loader) GetModulesByExclusiveGroup added in v1.70.0

func (l *Loader) GetModulesByExclusiveGroup(exclusiveGroup string) []string

func (*Loader) Installer added in v1.74.0

func (l *Loader) Installer() Installer

Installer returns installer instance

func (*Loader) LoadModule

func (l *Loader) LoadModule(_, modulePath string) (*addonmodules.BasicModule, error)

LoadModule implements the module loader interface from addon-operator, it reads single directory and returns BasicModule modulePath is in the following format: /deckhouse-controller/downloaded/<module_name>/<module_version>

func (*Loader) LoadModules

func (l *Loader) LoadModules() ([]*addonmodules.BasicModule, error)

LoadModules implements the module loader interface from addon-operator, used for registering modules in addon-operator

func (*Loader) LoadModulesFromFS

func (l *Loader) LoadModulesFromFS(ctx context.Context) error

LoadModulesFromFS parses and ensures modules from FS

func (*Loader) Sync

func (l *Loader) Sync(ctx context.Context) error

Sync syncs fs and cluster, restores or deletes modules

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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