2024-07-08 10:53:12 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
JOB=$1
|
|
|
|
NAMESPACE="${2:-default}"
|
2024-09-04 13:35:14 -05:00
|
|
|
CLUSTER="${3:-main}"
|
2024-07-08 10:53:12 -05:00
|
|
|
|
|
|
|
[[ -z "${JOB}" ]] && echo "Job name not specified" && exit 1
|
|
|
|
while true; do
|
|
|
|
STATUS="$(kubectl --context "${CLUSTER}" -n "${NAMESPACE}" get pod -l job-name="${JOB}" -o jsonpath='{.items[*].status.phase}')"
|
|
|
|
if [ "${STATUS}" == "Pending" ]; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
done
|