79235517

Date: 2024-11-28 23:34:53
Score: 0.5
Natty:
Report link

I found the issue. The working option is the third one (including the kubectl command directly into the condition). The only additional thing I was missing is that I needed to add "sudo" before the command. I didn't have to do it within the VM because the user it was part of the suddoers.

PS. The first two were still getting stuck within the loop even though I added the sudo to the command.

echo "Waiting for the dev secret to be created ...... "
while [ $(sudo kubectl get secrets -n dev | grep "dev" | wc -l) -eq 0 ]
do
    echo "inside dev secret loop ...... " >> /tmp/var.txt
    sleep 1
done
Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: GTGabaaron