client

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteHelmRelease

func DeleteHelmRelease(ctx context.Context, name, namespace string) error

DeleteHelmRelease deletes a HelmRelease CR and its associated values Secret if present.

func DeleteHelmSource added in v4.1.0

func DeleteHelmSource(ctx context.Context, cfg HelmReleaseConfig) error

DeleteHelmSource deletes the source CR (HelmRepository or OCIRepository) created by ensureHelmSource. It is a no-op if SourceURL is empty (i.e. the source was pre-existing and not created by the framework).

func InstallApp

func InstallApp(ctx context.Context, app *application.Application)

InstallApp installs the given App then waits for it to be marked as installed. Timeout can be controlled via the provided context

func InstallHelmRelease

func InstallHelmRelease(ctx context.Context, cfg HelmReleaseConfig)

InstallHelmRelease creates a HelmRelease CR and waits for it to become ready. It ensures the HelmRelease namespace exists on the MC. Target and storage namespaces are created by Flux via spec.install.createNamespace. Timeout can be controlled via the provided context.

func IsHelmReleaseReady

func IsHelmReleaseReady(ctx context.Context, name, namespace string) (bool, error)

IsHelmReleaseReady checks if a HelmRelease has the Ready condition set to True.

func IsHelmReleaseVersion

func IsHelmReleaseVersion(ctx context.Context, name, namespace, version string) (bool, error)

IsHelmReleaseVersion checks if a HelmRelease has the expected chart version in its status history.

func UpdateHelmReleaseVersion

func UpdateHelmReleaseVersion(ctx context.Context, cfg HelmReleaseConfig, version string)

UpdateHelmReleaseVersion updates the chart version for an existing HelmRelease. For HelmRepository sources, it updates spec.chart.spec.version on the HelmRelease. For OCIRepository sources, it updates spec.ref.tag on the OCIRepository (sourced from cfg).

Types

type HelmReleaseConfig

type HelmReleaseConfig struct {
	// Name is the name of the HelmRelease resource.
	Name string
	// Namespace is the namespace where the HelmRelease CR will be created.
	Namespace string
	// TargetNamespace is the namespace where the Helm chart will be installed.
	TargetNamespace string
	// StorageNamespace is the namespace used for Helm storage.
	// If empty, defaults to the HelmRelease namespace.
	StorageNamespace string
	// ReleaseName is the Helm release name. If empty, defaults to the HelmRelease name.
	ReleaseName string
	// ChartName is the name of the chart in the source.
	ChartName string
	// ChartVersion is the version of the chart to install.
	ChartVersion string
	// SourceKind specifies the kind of source reference.
	// Defaults to SourceKindOCIRepository if not set.
	SourceKind SourceKind
	// SourceName is the name of the source reference (HelmRepository or OCIRepository).
	SourceName string
	// SourceNamespace is the namespace of the source reference.
	// If empty, defaults to the HelmRelease namespace.
	SourceNamespace string
	// SourceURL is the URL of the source to create automatically.
	// For SourceKindHelmRepository: an OCI URL ("oci://registry/path") or HTTPS URL.
	// For SourceKindOCIRepository: an OCI URL ("oci://registry/path/chart").
	// When set, the framework creates the source CR before installing the HelmRelease.
	// If empty, the source CR must already exist in the cluster.
	SourceURL string
	// Values is the raw values YAML to pass to the chart.
	Values string
	// Interval is the reconciliation interval. Defaults to 5m.
	Interval time.Duration
	// Timeout is the time to wait for Helm operations. Defaults to 5m.
	Timeout time.Duration
	// Retries is the number of retries for install/upgrade remediation. Defaults to 10.
	Retries *int
	// ServiceAccountName is the Kubernetes service account to impersonate when reconciling.
	// Required by clusters with the flux-multi-tenancy Kyverno policy.
	ServiceAccountName string
	// KubeConfigSecretName is the name of the secret containing kubeconfig for remote cluster access.
	// Required when deploying to a workload cluster from the management cluster.
	KubeConfigSecretName string
}

HelmReleaseConfig holds the configuration needed to create a HelmRelease CR.

type SourceKind

type SourceKind string

SourceKind represents the kind of source reference used by a HelmRelease.

const (
	// SourceKindHelmRepository uses spec.chart with a HelmRepository sourceRef.
	SourceKindHelmRepository SourceKind = "HelmRepository"
	// SourceKindOCIRepository uses spec.chartRef with an OCIRepository reference.
	SourceKindOCIRepository SourceKind = "OCIRepository"

	// DefaultGiantSwarmHelmRepositoryURL is the default OCI registry for Giant Swarm Helm charts.
	DefaultGiantSwarmHelmRepositoryURL = "oci://gsoci.azurecr.io/charts/giantswarm"
)

Jump to

Keyboard shortcuts

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