Home > Back-end >  skip Helm uninstall interactive request
skip Helm uninstall interactive request

Time:02-03

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

CodePudding user response:

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...

CodePudding user response:

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
}
  •  Tags:  
  • Related