fixing issue with multiple applications have similar name.

This commit is contained in:
kyler 2022-04-21 21:46:50 -06:00
parent 8ba9735212
commit bdf6641fac

View File

@ -28,8 +28,8 @@ do
echo "$list" && read -p "Please type a number : " selection echo "$list" && read -p "Please type a number : " selection
app=$(echo -e "$list" | grep ^$selection | awk '{print $2}' | cut -c 4-) app=$(echo -e "$list" | grep ^$selection | awk '{print $2}' | cut -c 4-)
pvc=$(echo -e "$list" | grep ^$selection || echo -e "\nInvalid selection") pvc=$(echo -e "$list" | grep ^$selection || echo -e "\nInvalid selection")
status=$(cli -m csv -c 'app chart_release query name,status' | grep $app | awk -F ',' '{print $2}'| tr -d " \t\n\r") && SECONDS=0 && timeout=200 status=$(cli -m csv -c 'app chart_release query name,status' | grep -w $app | awk -F ',' '{print $2}'| tr -d " \t\n\r") && SECONDS=0 && timeout=200
[[ "$status" != "STOPPED" ]] && echo -e "\nScaling down $app" && midclt call chart.release.scale $app '{"replica_count": 0}' &> /dev/null [[ "$status" != "STOPPED" ]] && echo -e "\nScaling down -w $app" && midclt call chart.release.scale $app '{"replica_count": 0}' &> /dev/null
while [[ "$SECONDS" -le "$timeout" && "$status" != "STOPPED" ]] while [[ "$SECONDS" -le "$timeout" && "$status" != "STOPPED" ]]
do do
status=$(cli -m csv -c 'app chart_release query name,status' | grep $app | awk -F ',' '{print $2}'|tr -d " \t\n\r") status=$(cli -m csv -c 'app chart_release query name,status' | grep $app | awk -F ',' '{print $2}'|tr -d " \t\n\r")