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 May 20, 2024
1 parent 992de83 commit 63f58ab
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 63f58ab

Please sign in to comment.