@@ -22,13 +22,25 @@ import (
2222 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2323)
2424
25+ // ReconcileStrategy is a string representation of the reconciliation strategy of a HelmChartProxy.
26+ type ReconcileStrategy string
27+
2528const (
2629 // HelmChartProxyFinalizer is the finalizer used by the HelmChartProxy controller to cleanup add-on resources when
2730 // a HelmChartProxy is being deleted.
2831 HelmChartProxyFinalizer = "helmchartproxy.addons.cluster.x-k8s.io"
2932
3033 // DefaultOCIKey is the default file name of the OCI secret key.
3134 DefaultOCIKey = "config.json"
35+
36+ // ReconcileStrategyContinuous is the default reconciliation strategy for HelmChartProxy. It will attempt to install the Helm
37+ // chart on a selected Cluster, update the Helm release to match the current HelmChartProxy spec, and delete the Helm release
38+ // if the Cluster no longer selected.
39+ ReconcileStrategyContinuous ReconcileStrategy = "Continuous"
40+
41+ // ReconcileStrategyInstallOnce attempts to install the Helm chart for a HelmChartProxy on a selected Cluster, and once
42+ // it is installed, it will not attempt to update or delete the Helm release on the Cluster again.
43+ ReconcileStrategyInstallOnce ReconcileStrategy = "InstallOnce"
3244)
3345
3446// HelmChartProxySpec defines the desired state of HelmChartProxy.
@@ -64,6 +76,14 @@ type HelmChartProxySpec struct {
6476 // +optional
6577 ValuesTemplate string `json:"valuesTemplate,omitempty"`
6678
79+ // ReconcileStrategy indicates whether a Helm chart should be continuously installed, updated, and uninstalled on selected Clusters,
80+ // or if it should be reconciled until it is successfully installed on selected Clusters and not otherwise updated or uninstalled.
81+ // If not specified, the default behavior will be to reconcile continuously. This field is immutable.
82+ // Possible values are `Continuous`, `InstallOnce`, or unset.
83+ // +kubebuilder:validation:Enum="";InstallOnce;Continuous;
84+ // +optional
85+ ReconcileStrategy string `json:"reconcileStrategy,omitempty"`
86+
6787 // Options represents CLI flags passed to Helm operations (i.e. install, upgrade, delete) and
6888 // include options such as wait, skipCRDs, timeout, waitForJobs, etc.
6989 // +optional
0 commit comments