I currently use the following script to wait for the job completion
ACTIVE=$(kubectl get jobs my-job -o jsonpath='{.status.active}')
until [ -z $ACTIVE ]; do ACTIVE=$(kubectl get jobs my-job -o jsonpath='{.status.active}') ; sleep 30 ; done
The problem is the job can either fail or be successful as it is a test job.
Is there a better way to achieve the same?