Skip to content

Commit

Permalink
DRIVERS-2882 Enable AKS local test (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Nov 4, 2024
1 parent c5418bb commit bde0dcb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 3 additions & 4 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,9 @@ tasks:
- func: "run oidc k8s local test"
vars:
VARIANT: gke
# TODO: This still has to be implemented.
# - func: "run oidc k8s local test"
# vars:
# VARIANT: aks
- func: "run oidc k8s local test"
vars:
VARIANT: aks

- name: "test-install-binaries"
tags: ["pr"]
Expand Down
7 changes: 6 additions & 1 deletion .evergreen/k8s/configure-pod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ fi
# Delete pods over one hour old in case they were not torn down.
echo "Deleting old pods..."
# Delete successful pods more than an hour old.
if [ "$(uname -s)" = "Darwin" ]; then
DATE="gdate"
else
DATE="date"
fi
# shellcheck disable=SC2046
kubectl get pods -l app=test-pod -o go-template --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' | awk '$2 <= "'$(date -d'now-1 hours' -Ins --utc | sed 's/+0000/Z/')'" { print $1 }' | xargs --no-run-if-empty kubectl delete pod
kubectl get pods -l app=test-pod -o go-template --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' | awk '$2 <= "'$($DATE -d'now-1 hours' -Ins --utc | sed 's/+0000/Z/')'" { print $1 }' | xargs --no-run-if-empty kubectl delete pod
# Delete pending (stuck) pods more than 5 minutes old.
kubectl get pods --all-namespaces -l app=test-pod --field-selector=status.phase=Pending -o json | jq '.items[] | select((now - (.metadata.creationTimestamp | fromdateiso8601)) > 600) | .metadata.name' | xargs -I{} kubectl delete pod {} --force --grace-period=0
echo "Deleting old pods... done."
Expand Down

0 comments on commit bde0dcb

Please sign in to comment.