Skip to content

Commit

Permalink
[pod-sweeper] Skip pending pods that haven't even started yet
Browse files Browse the repository at this point in the history
Solves issue:
```
date: invalid date '+%s'
/script/sweep-pod.sh: line 53: [: : integer expression expected
```
  • Loading branch information
szemek committed Jul 1, 2024
1 parent d8d9387 commit f7b49b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/airbyte-pod-sweeper/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ data:
POD_STATUS=`echo $POD | cut -d " " -f 2`
POD_DATE_STR=`echo $POD | cut -d " " -f 3`
POD_START_DATE_STR=`echo $POD | cut -d " " -f 4`
if [ "$POD_STATUS" = "Pending" ] && [ -z "$POD_DATE_STR" ] && [ -z "$POD_START_DATE_STR" ]; then
echo "Pod ${POD_NAME} hasn't started yet. Skipping..."
continue
fi
POD_DATE=`date -d ${POD_DATE_STR:-$POD_START_DATE_STR} '+%s'`
if [ -n "${RUNNING_TTL_MINUTES}" ] && [ "$POD_STATUS" = "Running" ]; then
if [ "$POD_DATE" -lt "$RUNNING_DATE" ]; then
Expand Down

0 comments on commit f7b49b1

Please sign in to comment.