Documentation
¶
Index ¶
- Constants
- func ComputeHash(chart operatorv1alpha1.HelmChartSpec, values map[string]interface{}) (string, error)
- func MergeValues(ctx context.Context, c client.Client, namespace string, ...) (map[string]interface{}, error)
- func NewSubReconcilers(c client.Client, scheme *runtime.Scheme, helmClient Client) *subreconciler.Chain[*operatorv1alpha1.HelmCapsule]
- type ChartCredentials
- type Client
- type ReleaseInfo
- type ReleaseOptions
- type ReleaseSubReconciler
- type UninstallOptions
Constants ¶
const ( ReasonChartFetch errx.Reason = "ChartFetchFailed" ReasonValuesBuild errx.Reason = "ValuesBuildFailed" ReasonReleaseNameConflict errx.Reason = "ReleaseNameConflict" ReasonHelm errx.Reason = "HelmFailed" ReasonUnsupportedKind errx.Reason = "UnsupportedValuesKind" ReasonKeyNotFound errx.Reason = "ValuesKeyNotFound" ReasonOrbitNotFound errx.Reason = "OrbitNotFound" ReasonCredentials errx.Reason = "ChartCredentialsInvalid" ReasonListFailed errx.Reason = "ListFailed" ReasonGetFailed errx.Reason = "GetFailed" )
const ( ReasonReleaseUpToDate errx.Reason = "ReleaseUpToDate" ReasonReleaseRetry errx.Reason = "ReleaseRetry" ReasonReleaseReconciling errx.Reason = "ReleaseReconciling" ReasonReleaseReconciled errx.Reason = "ReleaseReconciled" ReasonReleasePending errx.Reason = "ReleasePending" ReasonAddressBookReadFailed errx.Reason = "AddressBookReadFailed" ReasonCapsuleSkipped errx.Reason = "CapsuleSkipped" )
Reason codes for logx log events emitted by the helm subreconciler. Error-decoration reason codes (ReasonChartFetch, ReasonValuesBuild, etc.) live alongside their typed errors in errors.go.
const (
DefaultTimeout = 5 * time.Minute
)
Variables ¶
This section is empty.
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 ¶
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 ¶
NewHelmSDKClient returns a Client backed by helm.sh/helm/v3. Pass mgr.GetConfig().
type ReleaseInfo ¶
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 ¶
func (r *ReleaseSubReconciler) Reconcile(ctx context.Context, hc *operatorv1alpha1.HelmCapsule) (ctrl.Result, error)