Change Helm chart version
ProprietaryPropagate a Helm chart version across every file that restates it: the chart's own Chart.yaml, the dependencies of the charts that consume it, Flux HelmRelease resources, k0rdent ClusterTemplate, ProviderTemplate and ServiceTemplate resources, and optionally files whose name encodes the version. dependencies[].version is a range, so by default a range that the new version already satisfies is left alone rather than pinned. Chart.lock is never edited, because its digest cannot be recomputed here; it is reported instead. Files under a chart's templates directory are Go template text and are left alone.
A k0rdent template's metadata.name also encodes the chart version, but a name is an identity that ClusterDeployment, Release and *TemplateChain resources point at. Renaming it here would leave those references dangling, so this recipe changes only version fields; org.openrewrite.kubernetes.k0rdent.ChangeTemplateVersion moves the name and everything that references it together.
org. openrewrite. kubernetes. helm. ChangeChartVersionRequired
The name of the chart whose version is changing, as it is written in its Chart.yaml and in the dependencies of the charts that consume it.
The new chart version. Must be an exact semantic version.
Optional
The version being replaced. When omitted, the version the chart's own Chart.yaml currently declares is used, which is only knowable for a chart that lives in this repository.
The new appVersion for the chart. A chart's appVersion names the application it packages, which usually moves independently of the chart version, so it is left alone unless this is set.
How to treat the range-valued version fields, dependencies[].version in a Chart.yaml and spec.chart.spec.version in a Flux HelmRelease. The exact-valued fields, a chart's own version and appVersion, are always set exactly. Default is Widen.
A glob expression selecting files whose name encodes the version. Matching files are renamed, substituting the new version for the old in either 1.2.3 or 1-2-3 spelling. When omitted, nothing is renamed.
mod run . --recipe= org. openrewrite. kubernetes. helm. ChangeChartVersion \
-P chartName= k0smotron \
-P newVersion=1.3.0Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.