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)
|
values=$(mktemp)
|
||||||
echo "$release" | jq -r '.values' | ${vals}/bin/vals eval > $values
|
echo "$release" | jq -r '.values' | ${vals}/bin/vals eval > $values
|
||||||
|
|
||||||
${kubernetes-helm}/bin/helm $@ \
|
name=$(echo "$release" | jq -r '.name')
|
||||||
-n $(echo "$release" | jq -r '.namespace // "default"') \
|
chart=$(echo "$release" | jq -r '.chart')
|
||||||
$(echo "$release" | jq -r '.name') \
|
namespace=$(echo "$release" | jq -r '.namespace // "default"')
|
||||||
$(echo "$release" | jq -r '.chart') \
|
|
||||||
-f $values
|
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
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue