There can be a brief moment when the "ig" job has terminated, but none of the stateful sets have created a pod yet, where everything within the namespace seems to be ready. That's why we also have to wait for the "api" pod to exist.
There is a different scenario when one or more "ig" jobs have been launched by quarks, and they seem to be in "completed" status and everything appears to be "ready". But then one of the "ig" jobs restarts and terminates all the scf pods again. So we need to wait until all the "ig" jobs are gone.
There can be a brief moment when the "ig" job has terminated, but none of the stateful sets have created a pod yet, where everything within the namespace seems to be ready. That's why we also have to wait for the "api" pod to exist.
There is a different scenario when one or more "ig" jobs have been launched by quarks, and they seem to be in "completed" status and everything appears to be "ready". But then one of the "ig" jobs restarts and terminates all the scf pods again. So we need to wait until all the "ig" jobs are gone.