Skip to content

Commit d258d95

Browse files
committed
fixup! feat: Update API types
1 parent 6ead29d commit d258d95

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

api/external/sigs.k8s.io/cluster-api-addon-provider-helm/api/v1alpha1/helmchartproxy_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
2528
const (
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

api/external/sigs.k8s.io/cluster-api-addon-provider-helm/api/v1alpha1/helmreleaseproxy_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ const (
3232

3333
// IsReleaseNameGeneratedAnnotation is the annotation signifying the Helm release name is auto-generated.
3434
IsReleaseNameGeneratedAnnotation = "helmreleaseproxy.addons.cluster.x-k8s.io/is-release-name-generated"
35+
36+
// ReleaseSuccessfullyInstalledAnnotation is the annotation signifying the Helm release has been successfully installed at least once.
37+
// This is used to determine if the HelmReleaseProxy is in a ready state for the InstallOnce strategy.
38+
ReleaseSuccessfullyInstalledAnnotation = "helmreleaseproxy.addons.cluster.x-k8s.io/release-successfully-installed"
3539
)
3640

3741
// HelmReleaseProxySpec defines the desired state of HelmReleaseProxy.
@@ -66,6 +70,14 @@ type HelmReleaseProxySpec struct {
6670
// +optional
6771
Values string `json:"values,omitempty"`
6872

73+
// ReconcileStrategy indicates whether a Helm chart should be continuously installed, updated, and uninstalled on the Cluster,
74+
// or if it should be reconciled until it is successfully installed on the Cluster and not otherwise updated or uninstalled.
75+
// If not specified, the default behavior will be to reconcile continuously. This field is immutable.
76+
// Possible values are `Continuous`, `InstallOnce`, or unset.
77+
// +kubebuilder:validation:Enum="";InstallOnce;Continuous;
78+
// +optional
79+
ReconcileStrategy string `json:"reconcileStrategy,omitempty"`
80+
6981
// Options represents the helm setting options which can be used to control behaviour of helm operations(Install, Upgrade, Delete, etc)
7082
// via options like wait, skipCrds, timeout, waitForJobs, etc.
7183
// +optional

0 commit comments

Comments
 (0)