Documentation
¶
Index ¶
- type Installer
- func (i *Installer) Install(ctx context.Context, module, version, tempModulePath string) error
- func (i *Installer) Restore(ctx context.Context, ms *v1alpha1.ModuleSource, module, version string) error
- func (i *Installer) Stage(ctx context.Context, module, version, tempModulePath string) error
- func (i *Installer) StageFromRegistry(ctx context.Context, ms *v1alpha1.ModuleSource, module, version string) error
- func (i *Installer) Uninstall(ctx context.Context, module string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer manages module installation via symlinks. Modules are copied to /deckhouse/downloaded/<module>/ and symlinked to /deckhouse/downloaded/modules/<module> for use by the operator.
func NewInstaller ¶
NewInstaller creates an installer that uses symlinks for module management. Directory structure:
/deckhouse/downloaded/<module>/ - Actual module files /deckhouse/downloaded/modules/<version> -> symlink to actual module
func (*Installer) Install ¶
Install copies a module from temp location to permanent storage and creates symlink. Process:
- Create /deckhouse/downloaded/<module>/ directory
- Remove old module version if exists(atomic update)
- Copy module files from tempModulePath to permanent location
- Remove old symlink if exists (atomic update)
- Create new symlink: /deckhouse/downloaded/<module> -> /deckhouse/downloaded/modules/<version>
func (*Installer) Restore ¶
func (i *Installer) Restore(ctx context.Context, ms *v1alpha1.ModuleSource, module, version string) error
Restore downloads a module from registry and creates symlink. Used for recovering modules after restart or failure. Process:
- Create /deckhouse/downloaded/<module>/ directory
- Remove old symlink if exists
- Download module from registry
- Create symlink: /deckhouse/downloaded/<module> -> /deckhouse/downloaded/modules/<version>
func (*Installer) Stage ¶ added in v1.76.3
Stage copies a module from temp location to permanent storage WITHOUT creating the symlink. The files end up at /deckhouse/downloaded/<module>/<version>/ but the module is not exposed to the operator, so an embedded copy of the same name keeps serving the module. The symlink is created later (by Install/Restore) once the embedded copy is gone.
func (*Installer) StageFromRegistry ¶ added in v1.76.3
func (i *Installer) StageFromRegistry(ctx context.Context, ms *v1alpha1.ModuleSource, module, version string) error
StageFromRegistry downloads a module from the registry to permanent storage WITHOUT creating the symlink. Mirrors Restore but skips activation.
func (*Installer) Uninstall ¶
Uninstall removes module symlink and cleans up module files. Process:
- Check if symlink exists (returns early if not)
- Explicitly remove symlink
- Defer: Remove entire module directory /deckhouse/downloaded/<module>
Two-phase cleanup ensures symlink is removed before directory cleanup