Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding diff_opts to allow adding aditional helm diff options. #125

Merged
merged 2 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ Deploy an helm chart
- `kubeconfig`: _Optional._ String containing a kubeconfig. Overrides `kubeconfig_path` and source configuration for cluster, token, and admin config.
- `kubeconfig_path`: _Optional._ File containing a kubeconfig. Overrides source configuration for cluster, token, and admin config.
- `show_diff`: _Optional._ Show the diff that is applied if upgrading an existing successful release. (Default: false)
- `skip_missing_values:` _Optional._ Missing values files are skipped if they are specified in the values but do not exist. (Default false)
- `diff_opts`: _Optional._ Additional options to be appended to `helm diff` command. (Default: "")
- `skip_missing_values:` _Optional._ Missing values files are skipped if they are specified in the values but do not exist.(Default false)

## Example

Expand Down Expand Up @@ -306,3 +307,24 @@ jobs:
chart: oci://01234567890.dkr.ecr.us-west-2.amazonaws.com/myapp-helm-repo
# ...
```

If `helm` chart contains `lookup` function
```yaml
resources:
- name: myapp-helm
type: helm
source:
env_vars:
HELM_DIFF_USE_INSECURE_SERVER_SIDE_DRY_RUN: true
#...
jobs:
# ...
plan:
- put: myapp-helm
params:
chart: ...
show_diff: true
diff_opts: "--dry-run=server"
# ...
# ...
```
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.37.0
1.37.1
3 changes: 2 additions & 1 deletion assets/out
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ test_logs=$(jq -r '.params.test_logs // "false"' < $payload)
devel=$(jq -r '.params.devel // "false"' < $payload)
force=$(jq -r '.params.force // "false"' < $payload)
show_diff=$(jq -r '.params.show_diff // "false"' < $payload)
diff_opts=$(jq -r '.params.diff_opts // ""' < $payload)
post_renderer=$(jq -r '.params.post_renderer // ""' < $payload)
reuse_values=$(jq -r '.params.reuse_values // "false"' < $payload)
reset_values=$(jq -r '.params.reset_values // "false"' < $payload)
Expand Down Expand Up @@ -300,7 +301,7 @@ helm_upgrade() {

if [ "$show_diff" = true ] ; then
echo "Release diff:"
$helm_bin diff --no-color=false "${helm_diff_args[@]}" | tee "$logfile"
$helm_bin diff --no-color=false "${helm_diff_args[@]}" ${diff_opts}| tee "$logfile"
fi

echo "Running command helm ${helm_echo_args[@]} | tee $logfile"
Expand Down