blocknode

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Kubernetes resources
	ServiceNameSuffix = "-block-node-server"
	PodLabelSelector  = "app.kubernetes.io/name=block-node-server"
	MetalLBAnnotation = "metallb.io/address-pool=public-address-pool"

	// Template paths
	NamespacePath     = "files/block-node/namespace.yaml"
	StorageConfigPath = "files/block-node/storage-config.yaml"
	ValuesPath        = "files/block-node/full-values.yaml"
	NanoValuesPath    = "files/block-node/nano-values.yaml"

	// Timeouts
	PodReadyTimeoutSeconds = 300
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles block node setup and management operations

func NewManager

func NewManager(blockConfig config.BlockNodeConfig) (*Manager, error)

NewManager creates a new block node manager

func (*Manager) AnnotateService

func (m *Manager) AnnotateService(ctx context.Context) error

AnnotateService annotates the block node service with MetalLB address pool

func (*Manager) ComputeValuesFile

func (m *Manager) ComputeValuesFile(profile string, valuesFile string) (string, error)

ComputeValuesFile generates the values file for helm installation based on profile. It provides the path to the generated values file.

NOTE: This method implements defense-in-depth validation. Even though the CLI layer validates paths using sanity.ValidateInputFile(), this method also validates to ensure safety regardless of the caller. This protects against future code changes where this method might be called from other places without proper validation.

func (*Manager) CreateNamespace

func (m *Manager) CreateNamespace(ctx context.Context, tempDir string) error

CreateNamespace creates the block-node namespace if it doesn't exist

func (*Manager) CreatePersistentVolumes

func (m *Manager) CreatePersistentVolumes(ctx context.Context, tempDir string) error

CreatePersistentVolumes creates PVs and PVCs from the storage config

func (*Manager) DeleteNamespace

func (m *Manager) DeleteNamespace(ctx context.Context, tempDir string) error

DeleteNamespace deletes the block-node namespace

func (*Manager) DeletePersistentVolumes

func (m *Manager) DeletePersistentVolumes(ctx context.Context, tempDir string) error

DeletePersistentVolumes deletes PVs and PVCs

func (*Manager) GetStoragePaths added in v0.6.0

func (m *Manager) GetStoragePaths() (archivePath, livePath, logPath string, err error)

GetStoragePaths returns the computed storage paths based on configuration. If individual paths are specified, they are used; otherwise, paths are derived from basePath. All paths are validated using sanity checks.

func (*Manager) InstallChart

func (m *Manager) InstallChart(ctx context.Context, valuesFile string) (bool, error)

InstallChart installs the block node helm chart

func (*Manager) SetupStorage

func (m *Manager) SetupStorage(ctx context.Context) error

SetupStorage creates the required directories for block node storage

func (*Manager) UninstallChart

func (m *Manager) UninstallChart(ctx context.Context) error

UninstallChart uninstalls the block node helm chart

func (*Manager) UpgradeChart added in v0.5.0

func (m *Manager) UpgradeChart(ctx context.Context, valuesFile string, reuseValues bool) error

UpgradeChart upgrades the block node helm chart

func (*Manager) WaitForPodReady

func (m *Manager) WaitForPodReady(ctx context.Context) error

WaitForPodReady waits for the block node pod to be ready

Jump to

Keyboard shortcuts

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