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 Jun 23, 2024
1 parent dfbe1d2 commit 6774c34
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} haven'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 6774c34

Please sign in to comment.