Skip to content

Commit 5cc5319

Browse files
authored
Merge pull request #307 from Jont828/reconcile-strategy
✨ Add `ReconcileStrategy` field to support continuous reconciliation or installing the Helm chart once
2 parents 0a102b9 + dad0b2c commit 5cc5319

21 files changed

+1344
-114
lines changed

Makefile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ get_go_version = $(shell go list -f "{{.Version}}" -m $1)
9999
# Binaries.
100100
#
101101
# Note: Need to use abspath so we can invoke these from subdirectories
102+
103+
# curl retries
104+
CURL_RETRIES=3
105+
102106
KUSTOMIZE_VER := v5.3.0
103107
KUSTOMIZE_BIN := kustomize
104108
KUSTOMIZE := $(abspath $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER))
@@ -190,6 +194,10 @@ TILT_PREPARE := $(abspath $(TOOLS_BIN_DIR)/$(TILT_PREPARE_BIN))
190194
GOLANGCI_LINT_BIN := golangci-lint
191195
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN))
192196

197+
HELM_VER := v3.14.4
198+
HELM_BIN := helm
199+
HELM := $(TOOLS_BIN_DIR)/$(HELM_BIN)-$(HELM_VER)
200+
193201
# Define Docker related variables. Releases should modify and double check these vars.
194202
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
195203
PROD_REGISTRY ?= registry.k8s.io/cluster-api-helm
@@ -394,6 +402,9 @@ ARTIFACTS ?= ${ROOT_DIR}/_artifacts
394402

395403
KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION))
396404

405+
.PHONY: install-tools # populate hack/tools/bin
406+
install-tools: $(ENVSUBST) $(KUSTOMIZE) $(HELM) $(GINKGO) # Should kubectl be added here?
407+
397408
.PHONY: test
398409
test: $(SETUP_ENVTEST) ## Run unit and integration tests
399410
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test ./... $(TEST_ARGS)
@@ -428,7 +439,7 @@ test-e2e-local: ## Run `docker-build` rule then run e2e tests.
428439
test-e2e-run
429440

430441
.PHONY: test-e2e-run-skip-manifest
431-
test-e2e-run-skip-manifest: $(GINKGO) $(ENVSUBST) generate-e2e-templates ## Run the end-to-end tests without updating the manifest.
442+
test-e2e-run-skip-manifest: $(GINKGO) $(ENVSUBST) generate-e2e-templates install-tools ## Run the end-to-end tests without updating the manifest.
432443
$(ENVSUBST) < $(E2E_CONF_FILE) > $(E2E_CONF_FILE_ENVSUBST) && \
433444
$(GINKGO) -v --trace -poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER) \
434445
-poll-progress-interval=$(GINKGO_POLL_PROGRESS_INTERVAL) --tags=e2e --focus="$(GINKGO_FOCUS)" \
@@ -729,6 +740,9 @@ $(GOLANGCI_LINT_BIN): $(GOLANGCI_LINT) ## Build a local copy of golangci-lint
729740
.PHONY: $(GINKGO_BIN)
730741
$(GINKGO_BIN): $(GINKGO) ## Build a local copy of ginkgo
731742

743+
.PHONY: $(HELM_BIN)
744+
$(HELM_BIN): $(HELM) ## Build a local copy of Helm
745+
732746
$(CONTROLLER_GEN): # Build controller-gen from tools folder.
733747
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(CONTROLLER_GEN_PKG) $(CONTROLLER_GEN_BIN) $(CONTROLLER_GEN_VER)
734748

@@ -787,3 +801,12 @@ $(GOLANGCI_LINT): .github/workflows/golangci-lint.yml # Download golangci-lint u
787801

788802
$(GINKGO): # Build ginkgo from tools folder.
789803
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(GINKGO_PKG) $(GINKGO_BIN) $(GINGKO_VER)
804+
805+
$(HELM): ## Put helm into tools folder.
806+
mkdir -p $(TOOLS_BIN_DIR)
807+
rm -f "$(TOOLS_BIN_DIR)/$(HELM_BIN)*"
808+
curl --retry $(CURL_RETRIES) -fsSL -o $(TOOLS_BIN_DIR)/get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
809+
chmod 700 $(TOOLS_BIN_DIR)/get_helm.sh
810+
USE_SUDO=false HELM_INSTALL_DIR=$(TOOLS_BIN_DIR) DESIRED_VERSION=$(HELM_VER) BINARY_NAME=$(HELM_BIN)-$(HELM_VER) $(TOOLS_BIN_DIR)/get_helm.sh
811+
ln -sf $(HELM) $(TOOLS_BIN_DIR)/$(HELM_BIN)
812+
rm -f $(TOOLS_BIN_DIR)/get_helm.sh

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/v1alpha1/helmchartproxy_webhook.go

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ import (
2121
"net/url"
2222
"time"
2323

24+
apierrors "k8s.io/apimachinery/pkg/api/errors"
2425
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2526
"k8s.io/apimachinery/pkg/runtime"
27+
"k8s.io/apimachinery/pkg/util/validation/field"
2628
ctrl "sigs.k8s.io/controller-runtime"
2729
logf "sigs.k8s.io/controller-runtime/pkg/log"
2830
"sigs.k8s.io/controller-runtime/pkg/webhook"
@@ -70,30 +72,50 @@ func (p *HelmChartProxy) Default() {
7072
var _ webhook.Validator = &HelmChartProxy{}
7173

7274
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
73-
func (r *HelmChartProxy) ValidateCreate() (admission.Warnings, error) {
74-
helmchartproxylog.Info("validate create", "name", r.Name)
75+
func (p *HelmChartProxy) ValidateCreate() (admission.Warnings, error) {
76+
helmchartproxylog.Info("validate create", "name", p.Name)
7577

76-
if err := isUrlValid(r.Spec.RepoURL); err != nil {
78+
if err := isUrlValid(p.Spec.RepoURL); err != nil {
7779
return nil, err
7880
}
7981

8082
return nil, nil
8183
}
8284

8385
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
84-
func (r *HelmChartProxy) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
85-
helmchartproxylog.Info("validate update", "name", r.Name)
86+
func (p *HelmChartProxy) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
87+
helmchartproxylog.Info("validate update", "name", p.Name)
8688

87-
if err := isUrlValid(r.Spec.RepoURL); err != nil {
88-
return nil, err
89+
var allErrs field.ErrorList
90+
old, ok := oldRaw.(*HelmChartProxy)
91+
if !ok {
92+
return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a HelmChartProxy but got a %T", old))
93+
}
94+
95+
if err := isUrlValid(p.Spec.RepoURL); err != nil {
96+
allErrs = append(allErrs,
97+
field.Invalid(field.NewPath("spec", "RepoURL"),
98+
p.Spec.ReleaseNamespace, err.Error()),
99+
)
100+
}
101+
102+
if p.Spec.ReconcileStrategy != old.Spec.ReconcileStrategy {
103+
allErrs = append(allErrs,
104+
field.Invalid(field.NewPath("spec", "ReconcileStrategy"),
105+
p.Spec.ReconcileStrategy, "field is immutable"),
106+
)
107+
}
108+
109+
if len(allErrs) > 0 {
110+
return nil, apierrors.NewInvalid(GroupVersion.WithKind("HelmChartProxy").GroupKind(), p.Name, allErrs)
89111
}
90112

91113
return nil, nil
92114
}
93115

94116
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type.
95-
func (r *HelmChartProxy) ValidateDelete() (admission.Warnings, error) {
96-
helmchartproxylog.Info("validate delete", "name", r.Name)
117+
func (p *HelmChartProxy) ValidateDelete() (admission.Warnings, error) {
118+
helmchartproxylog.Info("validate delete", "name", p.Name)
97119

98120
// TODO(user): fill in your validation logic upon object deletion.
99121
return nil, nil

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

api/v1alpha1/helmreleaseproxy_webhook.go

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,48 +59,55 @@ func (p *HelmReleaseProxy) Default() {
5959
var _ webhook.Validator = &HelmReleaseProxy{}
6060

6161
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type.
62-
func (r *HelmReleaseProxy) ValidateCreate() (admission.Warnings, error) {
63-
helmreleaseproxylog.Info("validate create", "name", r.Name)
62+
func (p *HelmReleaseProxy) ValidateCreate() (admission.Warnings, error) {
63+
helmreleaseproxylog.Info("validate create", "name", p.Name)
6464

6565
// TODO(user): fill in your validation logic upon object creation.
6666
return nil, nil
6767
}
6868

6969
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
70-
func (r *HelmReleaseProxy) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
71-
helmreleaseproxylog.Info("validate update", "name", r.Name)
70+
func (p *HelmReleaseProxy) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
71+
helmreleaseproxylog.Info("validate update", "name", p.Name)
7272

7373
var allErrs field.ErrorList
7474
old, ok := oldRaw.(*HelmReleaseProxy)
7575
if !ok {
7676
return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a HelmReleaseProxy but got a %T", old))
7777
}
7878

79-
if !reflect.DeepEqual(r.Spec.RepoURL, old.Spec.RepoURL) {
79+
if !reflect.DeepEqual(p.Spec.RepoURL, old.Spec.RepoURL) {
8080
allErrs = append(allErrs,
8181
field.Invalid(field.NewPath("spec", "RepoURL"),
82-
r.Spec.RepoURL, "field is immutable"),
82+
p.Spec.RepoURL, "field is immutable"),
8383
)
8484
}
8585

86-
if !reflect.DeepEqual(r.Spec.ChartName, old.Spec.ChartName) {
86+
if !reflect.DeepEqual(p.Spec.ChartName, old.Spec.ChartName) {
8787
allErrs = append(allErrs,
8888
field.Invalid(field.NewPath("spec", "ChartName"),
89-
r.Spec.ChartName, "field is immutable"),
89+
p.Spec.ChartName, "field is immutable"),
9090
)
9191
}
9292

93-
if !reflect.DeepEqual(r.Spec.ReleaseNamespace, old.Spec.ReleaseNamespace) {
93+
if !reflect.DeepEqual(p.Spec.ReleaseNamespace, old.Spec.ReleaseNamespace) {
9494
allErrs = append(allErrs,
9595
field.Invalid(field.NewPath("spec", "ReleaseNamespace"),
96-
r.Spec.ReleaseNamespace, "field is immutable"),
96+
p.Spec.ReleaseNamespace, "field is immutable"),
97+
)
98+
}
99+
100+
if p.Spec.ReconcileStrategy != old.Spec.ReconcileStrategy {
101+
allErrs = append(allErrs,
102+
field.Invalid(field.NewPath("spec", "ReconcileStrategy"),
103+
p.Spec.ReconcileStrategy, "field is immutable"),
97104
)
98105
}
99106

100107
// TODO: add webhook for ReleaseName. Currently it's being set if the release name is generated.
101108

102109
if len(allErrs) > 0 {
103-
return nil, apierrors.NewInvalid(GroupVersion.WithKind("HelmReleaseProxy").GroupKind(), r.Name, allErrs)
110+
return nil, apierrors.NewInvalid(GroupVersion.WithKind("HelmReleaseProxy").GroupKind(), p.Name, allErrs)
104111
}
105112

106113
return nil, nil

config/crd/bases/addons.cluster.x-k8s.io_helmchartproxies.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,17 @@ spec:
259259
after a Helm install/upgrade has been performed.
260260
type: boolean
261261
type: object
262+
reconcileStrategy:
263+
description: |-
264+
ReconcileStrategy indicates whether a Helm chart should be continuously installed, updated, and uninstalled on selected Clusters,
265+
or if it should be reconciled until it is successfully installed on selected Clusters and not otherwise updated or uninstalled.
266+
If not specified, the default behavior will be to reconcile continuously. This field is immutable.
267+
Possible values are `Continuous`, `InstallOnce`, or unset.
268+
enum:
269+
- ""
270+
- InstallOnce
271+
- Continuous
272+
type: string
262273
releaseName:
263274
description: ReleaseName is the release name of the installed Helm
264275
chart. If it is not specified, a name will be generated.

config/crd/bases/addons.cluster.x-k8s.io_helmreleaseproxies.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,17 @@ spec:
266266
after a Helm install/upgrade has been performed.
267267
type: boolean
268268
type: object
269+
reconcileStrategy:
270+
description: |-
271+
ReconcileStrategy indicates whether a Helm chart should be continuously installed, updated, and uninstalled on the Cluster,
272+
or if it should be reconciled until it is successfully installed on the Cluster and not otherwise updated or uninstalled.
273+
If not specified, the default behavior will be to reconcile continuously. This field is immutable.
274+
Possible values are `Continuous`, `InstallOnce`, or unset.
275+
enum:
276+
- ""
277+
- InstallOnce
278+
- Continuous
279+
type: string
269280
releaseName:
270281
description: ReleaseName is the release name of the installed Helm
271282
chart. If it is not specified, a name will be generated.

config/manager/manager.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ spec:
3333
- --leader-elect
3434
- "--diagnostics-address=${CAAPH_DIAGNOSTICS_ADDRESS:=:8443}"
3535
- "--insecure-diagnostics=${CAAPH_INSECURE_DIAGNOSTICS:=false}"
36+
- "--sync-period=${CAAPH_SYNC_PERIOD:=10m}"
3637
- "--v=2"
3738
image: controller:latest
3839
imagePullPolicy: Always

controllers/helmchartproxy/helmchartproxy_controller.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,14 @@ func (r *HelmChartProxyReconciler) Reconcile(ctx context.Context, req ctrl.Reque
187187
func (r *HelmChartProxyReconciler) reconcileNormal(ctx context.Context, helmChartProxy *addonsv1alpha1.HelmChartProxy, clusters []clusterv1.Cluster, helmReleaseProxies []addonsv1alpha1.HelmReleaseProxy) error {
188188
log := ctrl.LoggerFrom(ctx)
189189

190-
log.V(2).Info("Starting reconcileNormal for chart proxy", "name", helmChartProxy.Name)
190+
log.V(2).Info("Starting reconcileNormal for chart proxy", "name", helmChartProxy.Name, "strategy", helmChartProxy.Spec.ReconcileStrategy)
191191

192-
err := r.deleteOrphanedHelmReleaseProxies(ctx, helmChartProxy, clusters, helmReleaseProxies)
193-
if err != nil {
194-
return err
192+
// If Reconcile strategy is not InstallOnce, delete orphaned HelmReleaseProxies
193+
if !(helmChartProxy.Spec.ReconcileStrategy == string(addonsv1alpha1.ReconcileStrategyInstallOnce)) {
194+
err := r.deleteOrphanedHelmReleaseProxies(ctx, helmChartProxy, clusters, helmReleaseProxies)
195+
if err != nil {
196+
return err
197+
}
195198
}
196199

197200
for _, cluster := range clusters {

controllers/helmchartproxy/helmchartproxy_controller_phases.go

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,29 @@ func (r *HelmChartProxyReconciler) reconcileForCluster(ctx context.Context, helm
7070
// TODO: Should we set a condition here?
7171
return errors.Wrapf(err, "failed to get HelmReleaseProxy for cluster %s", cluster.Name)
7272
}
73-
// log.V(2).Info("Found existing HelmReleaseProxy", "cluster", cluster.Name, "release", existingHelmReleaseProxy.Name)
7473

75-
if existingHelmReleaseProxy != nil && shouldReinstallHelmRelease(ctx, existingHelmReleaseProxy, helmChartProxy) {
76-
log.V(2).Info("Reinstalling Helm release by deleting and creating HelmReleaseProxy", "helmReleaseProxy", existingHelmReleaseProxy.Name)
77-
if err := r.deleteHelmReleaseProxy(ctx, existingHelmReleaseProxy); err != nil {
78-
conditions.MarkFalse(helmChartProxy, addonsv1alpha1.HelmReleaseProxySpecsUpToDateCondition, addonsv1alpha1.HelmReleaseProxyDeletionFailedReason, clusterv1.ConditionSeverityError, "%s", err.Error())
74+
if helmChartProxy.Spec.ReconcileStrategy == string(addonsv1alpha1.ReconcileStrategyInstallOnce) {
75+
if internal.HasHelmReleaseBeenSuccessfullyInstalled(existingHelmReleaseProxy) {
76+
log.V(2).Info("HelmReleaseProxy has been installed on InstallOnce mode, nothing to do", "helmReleaseProxy", existingHelmReleaseProxy.Name, "cluster", cluster.Name)
7977

80-
return err
78+
return nil
8179
}
80+
} else { // ReconcileStrategy == `Continuous` or unset
81+
if existingHelmReleaseProxy != nil && shouldReinstallHelmRelease(ctx, existingHelmReleaseProxy, helmChartProxy) {
82+
log.V(2).Info("Reinstalling Helm release by deleting and creating HelmReleaseProxy", "helmReleaseProxy", existingHelmReleaseProxy.Name)
83+
if err := r.deleteHelmReleaseProxy(ctx, existingHelmReleaseProxy); err != nil {
84+
conditions.MarkFalse(helmChartProxy, addonsv1alpha1.HelmReleaseProxySpecsUpToDateCondition, addonsv1alpha1.HelmReleaseProxyDeletionFailedReason, clusterv1.ConditionSeverityError, "%s", err.Error())
8285

83-
// TODO: Add a check on requeue to make sure that the HelmReleaseProxy isn't still deleting
84-
log.V(2).Info("Successfully deleted HelmReleaseProxy on cluster, returning to requeue for reconcile", "cluster", cluster.Name)
85-
conditions.MarkFalse(helmChartProxy, addonsv1alpha1.HelmReleaseProxySpecsUpToDateCondition, addonsv1alpha1.HelmReleaseProxyReinstallingReason, clusterv1.ConditionSeverityInfo, "HelmReleaseProxy on cluster '%s' successfully deleted, preparing to reinstall", cluster.Name)
86+
return err
87+
}
8688

87-
return nil // Try returning early so it will requeue
88-
// TODO: should we continue in the loop or just requeue?
89+
// TODO: Add a check on requeue to make sure that the HelmReleaseProxy isn't still deleting
90+
log.V(2).Info("Successfully deleted HelmReleaseProxy on cluster, returning to requeue for reconcile", "cluster", cluster.Name)
91+
conditions.MarkFalse(helmChartProxy, addonsv1alpha1.HelmReleaseProxySpecsUpToDateCondition, addonsv1alpha1.HelmReleaseProxyReinstallingReason, clusterv1.ConditionSeverityInfo, "HelmReleaseProxy on cluster '%s' successfully deleted, preparing to reinstall", cluster.Name)
92+
93+
return nil // Try returning early so it will requeue
94+
// TODO: should we continue in the loop or just requeue?
95+
}
8996
}
9097

9198
values, err := internal.ParseValues(ctx, r.Client, helmChartProxy.Spec, &cluster)
@@ -219,6 +226,7 @@ func constructHelmReleaseProxy(existing *addonsv1alpha1.HelmReleaseProxy, helmCh
219226
}
220227
}
221228

229+
helmReleaseProxy.Spec.ReconcileStrategy = helmChartProxy.Spec.ReconcileStrategy
222230
helmReleaseProxy.Spec.Version = helmChartProxy.Spec.Version
223231
helmReleaseProxy.Spec.Values = parsedValues
224232
helmReleaseProxy.Spec.Options = helmChartProxy.Spec.Options

0 commit comments

Comments
 (0)