Skip to content

Commit

Permalink
Update healthcheck.sh
Browse files Browse the repository at this point in the history
moving clear_evicted_pods function call to run inside the healthcheck function
  • Loading branch information
EliseCastle23 authored Mar 4, 2024
1 parent a441284 commit 190fa5d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gen3/bin/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ gen3_healthcheck() {
internetAccessExplicitProxy=false
fi

gen3_log_info "Clearing Evicted pods"
sleep 5
clear_evicted_pods

local healthJson=$(cat - <<EOM
{
"pendingTimeoutPods": $pendingTimeoutPods,
Expand Down Expand Up @@ -206,9 +210,7 @@ EOM
}

clear_evicted_pods() {
g3kubectl get pods -A -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete pods \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c ' "$@" > /dev/null 2>&1' _ 2> /dev/null || true
g3kubectl get pods -A -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete pods \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c 2> /dev/null || true
}

gen3_healthcheck "$@"

clear_evicted_pods

0 comments on commit 190fa5d

Please sign in to comment.