Team,
I have multiple variables values to be checked and run for loop but I see no else execution when no such variable is set on bash.
#!/bin/bash
if [[ $TEST_PERF_CLASS="DFC" || $TEST_PERF_CLASS="GFC" &&
${!K8S_Node_Name}="ALLCORDONED" ]]; then
for node in ${K8S_Node_Name[@]}; do
kubectl describe $node
done
else
printf "Invalid node or No Variables are set in env yet."
fi
expected output:
Invalid node or No Variables are set in env yet.
Actual Output:
prints nothing.. << empty