mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-15 01:13:51 +01:00
helm: only upgrade when there are changes
This commit is contained in:
parent
844eca48a3
commit
c2ed155e66
1 changed files with 14 additions and 5 deletions
|
|
@ -31,11 +31,20 @@ writeShellScriptBin "kubenix" ''
|
|||
values=$(mktemp)
|
||||
echo "$release" | jq -r '.values' | ${vals}/bin/vals eval > $values
|
||||
|
||||
${kubernetes-helm}/bin/helm $@ \
|
||||
-n $(echo "$release" | jq -r '.namespace // "default"') \
|
||||
$(echo "$release" | jq -r '.name') \
|
||||
$(echo "$release" | jq -r '.chart') \
|
||||
-f $values
|
||||
name=$(echo "$release" | jq -r '.name')
|
||||
chart=$(echo "$release" | jq -r '.chart')
|
||||
namespace=$(echo "$release" | jq -r '.namespace // "default"')
|
||||
|
||||
args="-n $namespace $name $chart -f $values"
|
||||
|
||||
# only apply when there are changes
|
||||
if [[ "$1" == "upgrade" ]]; then
|
||||
if ${kubernetes-helm}/bin/helm diff upgrade $args --allow-unreleased --detailed-exitcode 2> /dev/null; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
${kubernetes-helm}/bin/helm $@ $args
|
||||
done
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue