Support helm release upgrade on helm chart name change#1447
Support helm release upgrade on helm chart name change#1447MichaelMorrisEst wants to merge 1 commit intofluxcd:mainfrom
Conversation
This re-introduces support that was lost going from 2.1.x -> 2.2.x but controls the behaviour through a feature gate so either the previous or current behaviour (default) can be achieved Signed-off-by: MichaelMorris <michael.morris@est.tech>
| // opt-in from v1.5.2 | ||
| DefaultToRetryOnFailure: false, | ||
| // UninstallOnChartNameChange | ||
| // opt-in from v1.5.4 |
There was a problem hiding this comment.
The chance of this going into a patch release is unlikely, this should thus indicate 1.6.0.
| targetReleaseNamespace = "release namespace" | ||
| targetReleaseName = "release name" | ||
| targetChartName = "chart name" | ||
| TargetChartName = "chart name" |
There was a problem hiding this comment.
This list of constants was always meant to be a descriptive reason (factored out to a const for code readability), not an identifier. Additionally, only exposing one of them creates a weak contract. I would prefer a solution where:
- All identifiers are public
- Identifiers do not contain spaces
|
Some additional thoughts:
|
|
How about having this setting on resource level rather than a global feature flag? |
Hi @artem-nefedov Are you suggesting some on the CRD? e.g. maybe adding something to the 'Uninstall' element of 'HelmRelease'? |
|
Hi @hiddeco I dont think Helm itself supports changing the helm release name, namespace or storage namespace and, as you state yourself, this might require an uninstall anyway. The proposed scope of chart name changes only I believe is consistent with what Helm supports. I'd be concerned about the complexity of implementing this for other changes particularly if there isnt anybody looking for it. Having said that, I am happy to work on it if you feel its the way to go, but I would need your advice on how it should be implemented. In relation to the default |
Sorry for the delayed reply. Yes, I meant something like this, only rather than 'Uninstall', I think the better place is 'Upgrade'. For example: spec:
upgrade:
chartNameChangePolicy: InPlaceUpdate # or "Reinstall" (default) |
Summary
Closes #870
Proposes to add a new feature gate
UninstallOnChartNameChange.When enabled (default), the current behaviour of uninstalling a Helm Release when the Helm chart name is changed shall remain unchanged. This results in a new Helm Release install.
When disabled, the Helm Release will not be uninstalled when the Helm chart name is changed. This results in a Helm upgrade being performed. This was the behaviour before Flux 2.2.0
This re-introduces support that was lost going from Flux 2.1.x -> 2.2.x but controls the behaviour through a feature gate so either the previous or current behaviour (default) can be achieved
Changes
UninstallOnChartNameChangefeature gate in internal/features/features.gomain.gotoHelmReleaseReconcilerfalseand the chart name has changed do not uninstall the HelmReleaseaction.targetChartNameto enable it to be referenced in the HelmRelease controller