Skip to content

Commit 53cbf8a

Browse files
committed
Fix jobs mode
1 parent 99e90e0 commit 53cbf8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

check_kubernetes.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,10 @@ mode_jobs() {
722722
fi
723723
for job in "${jobs[@]}"; do
724724
((total_jobs++))
725-
job_fail_count=$(echo "$data" | jq -r ".items[] | select(.status.failed and .metadata.name==\"$job\") | .status.failed")
725+
job_fail_count=$(echo "$data" | jq -r ".items[] | select(.metadata.namespace==\"$ns\" and .status.failed and .metadata.name==\"$job\") | .status.failed")
726726
total_failed_count="$((total_failed_count+job_fail_count))"
727727
if [ "$job_fail_count" -ge "${WARN}" ]; then
728-
OUTPUT="${OUTPUT}Job $job has $job_fail_count failures\n"
728+
OUTPUT="${OUTPUT}Job $ns/$job has $job_fail_count failures\n"
729729
EXITCODE=1
730730
elif [ "$job_fail_count" -ge "${CRIT}" ]; then
731731
EXITCODE=2

0 commit comments

Comments
 (0)