The script currently says
STATE=$(ibmcloud ks cluster-get $CLUSTER_NAME -s | awk '/State:/ {print $2}')
This has to be changed to
STATE=$(ibmcloud ks cluster-get $CLUSTER_NAME -s | awk '/^State:/ {print $2}')
(note the caret), to distinguish it from the "Master State:" line which now also appears in that output.
The script currently says STATE=$(ibmcloud ks cluster-get $CLUSTER_NAME -s | awk '/State:/ {print $2}')
This has to be changed to STATE=$(ibmcloud ks cluster-get $CLUSTER_NAME -s | awk '/^State:/ {print $2}') (note the caret), to distinguish it from the "Master State:" line which now also appears in that output.