symlink

package
v1.77.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func NewInstaller(registry *registry.Service, logger *log.Logger) *Installer

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

func (i *Installer) Install(ctx context.Context, module, version, tempModulePath string) error

Install copies a module from temp location to permanent storage and creates symlink. Process:

  1. Create /deckhouse/downloaded/<module>/ directory
  2. Remove old module version if exists(atomic update)
  3. Copy module files from tempModulePath to permanent location
  4. Remove old symlink if exists (atomic update)
  5. 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:

  1. Create /deckhouse/downloaded/<module>/ directory
  2. Remove old symlink if exists
  3. Download module from registry
  4. Create symlink: /deckhouse/downloaded/<module> -> /deckhouse/downloaded/modules/<version>

func (*Installer) Stage added in v1.76.3

func (i *Installer) Stage(ctx context.Context, module, version, tempModulePath string) error

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

func (i *Installer) Uninstall(ctx context.Context, module string) error

Uninstall removes module symlink and cleans up module files. Process:

  1. Check if symlink exists (returns early if not)
  2. Explicitly remove symlink
  3. Defer: Remove entire module directory /deckhouse/downloaded/<module>

Two-phase cleanup ensures symlink is removed before directory cleanup

Jump to

Keyboard shortcuts

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