'skip Helm uninstall interactive request
i want to automate a bit helm install/uninstall but during helm uninstall command it will become user interactiv asking:
Do you want to continue to delete suite-helm? (yY|nN):
Is any flag or way to skip this part? Thanks in advance
Solution 1:[1]
finaly i found a way using expect and here it is: expect -c ' spawn ./helm_remove.sh; expect (yY|nN); send "y\n"; interact'
into sh file i will have helm uninstall suite-helm -n suite-helm and some other commands to remove pvs deployment...
Solution 2:[2]
You would have to wrap in a shell script or function.
Something like (just spitballing here, not even syntax checking)
helm-delete() {
helm status $1
echo "Do you want to continue to delete suite-helm? (yY|nN):"
read -rs -k 1 ans
case "${ans}" in
y|Y|$'\n')
printf "Yes\n"
helm delete %1
;;
*) # This is the default
printf "No\n"
return 0
esac
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Alin-Bogdan Zirbo |
Solution 2 | Josh Beauregard |