Help us shape the future of Go! Take the 2026 Go Developer Survey

helm

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = 5 * time.Minute
)

Variables

View Source
var (
	ErrChartFetch          = errors.New("chart fetch failed")
	ErrValuesBuild         = errors.New("values build failed")
	ErrReleaseNameConflict = errors.New("release name conflict")
)

Functions

func ComputeHash

func ComputeHash(chart operatorv1alpha1.HelmChartSpec, values map[string]interface{}) (string, error)

ComputeHash returns a SHA-256 of chart spec + values, used in status.ValuesHash to skip no-op upgrades.

func MergeValues

func MergeValues(ctx context.Context, c client.Client, namespace string, spec *operatorv1alpha1.HelmCapsuleSpec) (map[string]interface{}, error)

MergeValues assembles the final values by layering component injection, ValuesFrom refs, and inline values.

func NewSubReconcilers

func NewSubReconcilers(c client.Client, scheme *runtime.Scheme, helmClient Client) *subreconciler.Chain[*operatorv1alpha1.HelmCapsule]

Types

type ChartCredentials

type ChartCredentials struct {
	Username string
	Password string
}

ChartCredentials is read from the Secret named in HelmChartSpec.CredentialsRef.

type Client

type Client interface {
	InstallOrUpgrade(ctx context.Context, releaseName, namespace string, chart operatorv1alpha1.HelmChartSpec, values map[string]interface{}, opts ReleaseOptions) (*ReleaseInfo, error)
	Uninstall(ctx context.Context, releaseName, namespace string, opts UninstallOptions) error
	GetRelease(releaseName, namespace string) (*ReleaseInfo, error)
}

Client abstracts Helm operations for testability.

func NewHelmSDKClient

func NewHelmSDKClient(restConfig *rest.Config) Client

NewHelmSDKClient returns a Client backed by helm.sh/helm/v3. Pass mgr.GetConfig().

type ReleaseInfo

type ReleaseInfo struct {
	Name        string
	Namespace   string
	Version     int
	Status      string
	ChartString string // "chartname-version"
}

type ReleaseOptions

type ReleaseOptions struct {
	Timeout       time.Duration
	Wait          bool
	Atomic        bool
	CleanupOnFail bool
	MaxHistory    int
	DisableHooks  bool
	// Credentials are used to authenticate to a private chart repository.
	// Nil means no authentication (public repo).
	Credentials *ChartCredentials
}

ReleaseOptions maps to HelmCapsuleSpec fields. Zero values match Helm defaults.

type ReleaseSubReconciler

type ReleaseSubReconciler struct {
	*subreconciler.BaseSubReconciler[*operatorv1alpha1.HelmCapsule]
	// contains filtered or unexported fields
}

func (*ReleaseSubReconciler) Name

func (r *ReleaseSubReconciler) Name() string

func (*ReleaseSubReconciler) Reconcile

type UninstallOptions

type UninstallOptions struct {
	Timeout      time.Duration // defaults to DefaultTimeout when zero
	KeepHistory  bool          // helm uninstall --keep-history
	DisableHooks bool
	Wait         bool
}

Jump to

Keyboard shortcuts

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