helm

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: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNamespace = errorx.NewNamespace("helm")

	ErrNotFound               = ErrNamespace.NewType("not_found", errorx.NotFound()) // Release or resource not found
	ErrRepoInvalid            = ErrNamespace.NewType("repo_invalid")                 // Repo invalid or unreachable
	ErrChartDependencyMissing = ErrNamespace.NewType("chart_dependency_missing")     // Chart dependencies missing
	ErrChartLoadFailed        = ErrNamespace.NewType("chart_load_failed")            // Failed to load chart from path or repo
	ErrInstallFailed          = ErrNamespace.NewType("install_failed")               // Helm install failed
	ErrUpgradeFailed          = ErrNamespace.NewType("upgrade_failed")               // Helm upgrade failed
	ErrUninstallFailed        = ErrNamespace.NewType("uninstall_failed")             // Helm uninstall failed
	ErrWaitTimeout            = ErrNamespace.NewType("wait_timeout", errorx.Timeout())
)

Functions

This section is empty.

Types

type DeployChartOptions

type DeployChartOptions struct {
	ValueOpts       *values.Options
	Atomic          bool
	Wait            bool
	Timeout         time.Duration
	CreateNamespace bool
	ReuseValues     bool
}

DeployChartOptions for idempotent install/upgrade

type InstallChartOptions

type InstallChartOptions struct {
	ValueOpts       *values.Options
	Atomic          bool
	Wait            bool
	Timeout         time.Duration
	CreateNamespace bool
}

InstallChartOptions for installing Helm charts

type Manager

type Manager interface {
	// AddRepo adds a Helm chart repository with the given options and updates it.
	AddRepo(name, url string, o RepoAddOptions) (*repo.ChartRepository, error)

	// InstallChart installs a Helm chart with the given options
	InstallChart(ctx context.Context, releaseName, chartRef, chartVersion, namespace string, o InstallChartOptions) (*release.Release, error)

	// UninstallChart uninstalls a Helm release by name in the specified namespace
	UninstallChart(releaseName, namespace string) error

	// UpgradeChart upgrades a Helm chart with the given options
	UpgradeChart(ctx context.Context, releaseName, chartRef, chartVersion, namespace string, o UpgradeChartOptions) (*release.Release, error)

	// DeployChart installs or upgrades a Helm chart with the given options
	// This is equivalent to "helm upgrade --install"
	DeployChart(ctx context.Context, releaseName, chartRef, chartVersion, namespace string, o DeployChartOptions) (*release.Release, error)

	// List lists Helm releases in the specified namespace
	// It only lists releases in deployed state
	List(namespace string, allNamespaces bool) ([]*release.Release, error)

	// ListAll lists Helm releases in all namespaces
	// It only lists releases in deployed state
	ListAll() ([]*release.Release, error)

	// GetRelease retrieves a Helm release by name in the specified namespace
	GetRelease(releaseName, namespace string) (*release.Release, error)

	// IsInstalled checks if a Helm release is installed in the specified namespace
	// It considers only releases in deployed state as "installed"
	IsInstalled(releaseName, namespace string) (bool, error)

	// WaitFor waits until the Helm release reaches the desired status or the timeout is reached
	WaitFor(rel *release.Release, status Status, timeout time.Duration) error
}

Manager defines the interface for managing Helm charts and releases

func NewManager

func NewManager(opts ...Option) (Manager, error)

NewManager creates a new Helm manager

type Option

type Option func(*helmManager)

func WithLogger

func WithLogger(log zerolog.Logger) Option

type RepoAddOptions

type RepoAddOptions struct {
	RepoFile  string
	RepoCache string
}

RepoAddOptions holds options for adding a Helm repo

type Status

type Status string
const (
	DefaultTimeout        = 5 * time.Minute
	StatusReady    Status = "ready"
	StatusDeleted  Status = "deleted"
)

type UpgradeChartOptions

type UpgradeChartOptions struct {
	ValueOpts   *values.Options
	Atomic      bool
	Wait        bool
	Timeout     time.Duration
	ReuseValues bool
}

UpgradeChartOptions for upgrading Helm charts

Jump to

Keyboard shortcuts

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