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 ¶
NewManager creates a new Helm manager
type RepoAddOptions ¶
RepoAddOptions holds options for adding a Helm repo
Click to show internal directories.
Click to hide internal directories.