Skip to content

Commit

Permalink
Fix template command to not print list of deleted files
Browse files Browse the repository at this point in the history
For all wrapped Helm commands the list of decrypted files is printed as
they get removed at the end of plugin execution. For the `template`
command this is undesired, as it means you cannot simply run `helm
secrets template` and get valid YAML output.

This change suppresses the output of deleted files for the `template`
only, meaning it does not alter the behavior of other commands, but just
fixes the `template` command to work as I imagine most people would
expect it to work.

[Fixes issues zendesk#126 and zendesk#132]
  • Loading branch information
jimeh committed Sep 23, 2019
1 parent 5f91bdf commit 735ac58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,9 @@ EOF
${HELM_BIN} ${TILLER_HOST:+--host "$TILLER_HOST" }"$cmd" $subcmd "$@" "${cmdopts[@]}"
helm_exit_code=$?
# cleanup on-the-fly decrypted files
[[ ${#decfiles[@]} -gt 0 ]] && rm -v "${decfiles[@]}"
local rmflags=(-v)
if [ "$cmd" == "template" ]; then rmflags=(); fi
[[ ${#decfiles[@]} -gt 0 ]] && rm "${rmflags[@]}" "${decfiles[@]}"
}

helm_command() {
Expand Down

0 comments on commit 735ac58

Please sign in to comment.