Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@ import (
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)

// ReconcileStrategy is a string representation of the reconciliation strategy of a HelmChartProxy.
type ReconcileStrategy string

const (
// HelmChartProxyFinalizer is the finalizer used by the HelmChartProxy controller to cleanup add-on resources when
// a HelmChartProxy is being deleted.
HelmChartProxyFinalizer = "helmchartproxy.addons.cluster.x-k8s.io"

// DefaultOCIKey is the default file name of the OCI secret key.
DefaultOCIKey = "config.json"

// ReconcileStrategyContinuous is the default reconciliation strategy for HelmChartProxy. It will attempt to install the Helm
// chart on a selected Cluster, update the Helm release to match the current HelmChartProxy spec, and delete the Helm release
// if the Cluster no longer selected.
ReconcileStrategyContinuous ReconcileStrategy = "Continuous"

// ReconcileStrategyInstallOnce attempts to install the Helm chart for a HelmChartProxy on a selected Cluster, and once
// it is installed, it will not attempt to update or delete the Helm release on the Cluster again.
ReconcileStrategyInstallOnce ReconcileStrategy = "InstallOnce"
)

// HelmChartProxySpec defines the desired state of HelmChartProxy.
Expand Down Expand Up @@ -64,6 +76,14 @@ type HelmChartProxySpec struct {
// +optional
ValuesTemplate string `json:"valuesTemplate,omitempty"`

// ReconcileStrategy indicates whether a Helm chart should be continuously installed, updated, and uninstalled on selected Clusters,
// or if it should be reconciled until it is successfully installed on selected Clusters and not otherwise updated or uninstalled.
// If not specified, the default behavior will be to reconcile continuously. This field is immutable.
// Possible values are `Continuous`, `InstallOnce`, or unset.
// +kubebuilder:validation:Enum="";InstallOnce;Continuous;
// +optional
ReconcileStrategy string `json:"reconcileStrategy,omitempty"`

// Options represents CLI flags passed to Helm operations (i.e. install, upgrade, delete) and
// include options such as wait, skipCRDs, timeout, waitForJobs, etc.
// +optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const (

// IsReleaseNameGeneratedAnnotation is the annotation signifying the Helm release name is auto-generated.
IsReleaseNameGeneratedAnnotation = "helmreleaseproxy.addons.cluster.x-k8s.io/is-release-name-generated"

// ReleaseSuccessfullyInstalledAnnotation is the annotation signifying the Helm release has been successfully installed at least once.
// This is used to determine if the HelmReleaseProxy is in a ready state for the InstallOnce strategy.
ReleaseSuccessfullyInstalledAnnotation = "helmreleaseproxy.addons.cluster.x-k8s.io/release-successfully-installed"
)

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

// ReconcileStrategy indicates whether a Helm chart should be continuously installed, updated, and uninstalled on the Cluster,
// or if it should be reconciled until it is successfully installed on the Cluster and not otherwise updated or uninstalled.
// If not specified, the default behavior will be to reconcile continuously. This field is immutable.
// Possible values are `Continuous`, `InstallOnce`, or unset.
// +kubebuilder:validation:Enum="";InstallOnce;Continuous;
// +optional
ReconcileStrategy string `json:"reconcileStrategy,omitempty"`

// Options represents the helm setting options which can be used to control behaviour of helm operations(Install, Upgrade, Delete, etc)
// via options like wait, skipCrds, timeout, waitForJobs, etc.
// +optional
Expand Down
50 changes: 25 additions & 25 deletions hack/third-party/caaph/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,62 @@ go 1.22.0

toolchain go1.23.0

require sigs.k8s.io/cluster-api-addon-provider-helm v0.2.6
require sigs.k8s.io/cluster-api-addon-provider-helm v0.3.1

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.30.3 // indirect
k8s.io/apiextensions-apiserver v0.30.3 // indirect
k8s.io/apimachinery v0.30.3 // indirect
k8s.io/client-go v0.30.3 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/api v0.31.3 // indirect
k8s.io/apiextensions-apiserver v0.31.3 // indirect
k8s.io/apimachinery v0.31.3 // indirect
k8s.io/client-go v0.31.3 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
sigs.k8s.io/cluster-api v1.8.4 // indirect
sigs.k8s.io/controller-runtime v0.18.5 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/cluster-api v1.9.4 // indirect
sigs.k8s.io/controller-runtime v0.19.4 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
Loading
Loading