helm.star¶
Bump Helm chart versions, chart dependencies and image tags in values files.
Edits are line-based, so comments and layout in Chart.yaml and values files stay as they were.
load("@fleet//helm.star", "charts", "set_chart_version", "set_app_version", "set_dependency", "set_image_tag")
| Function | What it does |
|---|---|
charts |
Lists the repo's Helm charts. |
set_chart_version |
Sets a chart's version in its Chart.yaml. |
set_app_version |
Sets a chart's appVersion in its Chart.yaml, keeping its quotes. |
set_dependency |
Sets the version of a chart dependency in every Chart.yaml that lists it. |
set_image_tag |
Sets the tag next to repository: <repository> in values files. |
charts¶
Lists the repo's Helm charts.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: The sorted directories that hold a Chart.yaml; the repo root is ..
Example
Used in: helm-image-tag
set_chart_version¶
Sets a chart's version in its Chart.yaml.
A newer version already there is kept, so a campaign never lowers one.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
chart |
The chart directory, as charts lists it. |
version |
The new chart version. |
Returns: True when the file changed.
Example
Used in: helm-image-tag
set_app_version¶
Sets a chart's appVersion in its Chart.yaml, keeping its quotes.
A newer version already there is kept, so a campaign never lowers one.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
chart |
The chart directory, as charts lists it. |
version |
The new application version. |
Returns: True when the file changed.
Example
Used in: helm-image-tag
set_dependency¶
Sets the version of a chart dependency in every Chart.yaml that lists it.
A newer version already there is kept, so a campaign never lowers one.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
name |
The dependency's name. |
version |
The new version or range, such as 15.5.x. |
Returns: The list of paths that changed. Remember to refresh Chart.lock with
helm dependency update in a run step if the repo commits it.
Example
charts/api/Chart.yaml
set_image_tag¶
Sets the tag next to repository: <repository> in values files.
Matches the common layout where an image is a mapping with sibling
repository and tag keys, at any depth. Quotes around the old tag
are kept; images with no tag key are left alone.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
repository |
The image repository as written, such as ghcr.io/acme/api. |
tag |
The new tag. |
include |
Glob patterns of the values files to edit. |
Returns: The list of paths that changed.
Example
charts/api/values.yaml
Used in: helm-image-tag