Skip to content

Commit 2dc0f5d

Browse files
Updated for review comments
Signed-off-by: MichaelMorris <michael.morris@est.tech>
1 parent cc70c6e commit 2dc0f5d

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

api/v2/helmrelease_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,9 +795,9 @@ type ChartNameChangeStrategy string
795795

796796
const (
797797
// Update the Helm release in place.
798-
InPlaceUpdate ChartNameChangeStrategy = "InPlaceUpdate"
798+
ChartNameChangeStrategyInPlaceUpdate ChartNameChangeStrategy = "InPlaceUpdate"
799799
// Reinstall the Helm release, uninstalling the existing Helm release
800-
Reinstall ChartNameChangeStrategy = "Reinstall"
800+
ChartNameChangeStrategyReinstall ChartNameChangeStrategy = "Reinstall"
801801
)
802802

803803
// Upgrade holds the configuration for Helm upgrade actions for this
@@ -904,6 +904,7 @@ type Upgrade struct {
904904
//
905905
// InPlaceUpdate: Update the Helm release in place.
906906
//
907+
// +kubebuilder:validation:Enum=InPlaceUpdate;Reinstall
907908
// +optional
908909
ChartNameChangeStrategy ChartNameChangeStrategy `json:"chartNameChangeStrategy,omitempty"`
909910
}

config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,9 @@ spec:
926926
Reinstall: Reinstall the Helm release, uninstalling the existing Helm release.
927927
928928
InPlaceUpdate: Update the Helm release in place.
929+
enum:
930+
- InPlaceUpdate
931+
- Reinstall
929932
type: string
930933
cleanupOnFail:
931934
description: |-

internal/controller/helmrelease_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context,
372372
// If the release target configuration has changed, we need to uninstall the
373373
// previous release target first. If we did not do this, the installation would
374374
// fail due to resources already existing.
375-
if reason, changed := action.ReleaseTargetChanged(obj, loadedChart.Name()); changed && (reason != action.TargetChartName || obj.Spec.Upgrade.ChartNameChangeStrategy == v2.Reinstall) {
375+
if reason, changed := action.ReleaseTargetChanged(obj, loadedChart.Name()); changed && (reason != action.TargetChartName || obj.Spec.Upgrade.ChartNameChangeStrategy == v2.ChartNameChangeStrategyReinstall) {
376376
log.Info(fmt.Sprintf("release target configuration changed (%s): running uninstall for current release", reason))
377377
if err = r.reconcileUninstall(ctx, getter, obj); err != nil && !errors.Is(err, intreconcile.ErrNoLatest) {
378378
return ctrl.Result{}, err

0 commit comments

Comments
 (0)