From bef53373a77d8197fdac39aafc9252b4403a5751 Mon Sep 17 00:00:00 2001 From: Hippo Date: Thu, 18 Oct 2018 03:54:31 +0800 Subject: [PATCH] Add reuse-values option (#95) --- README.md | 1 + assets/out | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index fcf69c8..9d2ec5f 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ on the cluster. * `recreate_pods`: *Optional.* This flag will cause all pods to be recreated when upgrading. (Default: false) * `show_diff`: *Optional.* Show the diff that is applied if upgrading an existing successful release. Will not be used when `devel` is set. (Default: false) * `exit_after_diff`: *Optional.* Show the diff but don't actually install/upgrade. (Default: false) +* `reuse_values`: *Optional.* When upgrading, reuse the last release's values. (Default: false) ## Example diff --git a/assets/out b/assets/out index 5efdddc..669c70f 100755 --- a/assets/out +++ b/assets/out @@ -38,6 +38,7 @@ show_diff=$(jq -r '.params.show_diff // "false"' < $payload) recreate_pods=$(jq -r '.params.recreate_pods // "false"' < $payload) tls_enabled=$(jq -r '.source.tls_enabled // "false"' < $payload) exit_after_diff=$(jq -r '.params.exit_after_diff // "false"' < $payload) +reuse_values=$(jq -r '.params.reuse_values // "false"' < $payload) if [ -z "$chart" ]; then if [[ "$test" == "false" && "$delete" == "false" ]]; then @@ -134,6 +135,11 @@ helm_upgrade() { if [ "$force" = true ]; then non_diff_args+=("--force") fi + if [ "$reuse_values" = true ]; then + upgrade_args+=("--reuse-values") + non_diff_args+=("--reuse-values") + fi + logfile="/tmp/log" mkdir -p /tmp