Documentation
¶
Index ¶
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) 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