symlink

package
v1.74.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

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) 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