Skip to content

Commit

Permalink
sweep pods from end time not start time (#10614)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhizor authored Feb 24, 2022
1 parent 4556674 commit 77ea0e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion charts/airbyte/files/sweep-pod.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

get_worker_pods () {
kubectl -n ${KUBE_NAMESPACE} -L airbyte -l airbyte=worker-pod --field-selector status.phase!=Running get pods -o go-template --template '{{range .items}} {{.metadata.name}} {{.status.phase}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}'
kubectl -n ${KUBE_NAMESPACE} -L airbyte -l airbyte=worker-pod \
--field-selector status.phase!=Running get pods \
-o=jsonpath='{range .items[*]} {.metadata.name} {.status.phase} {.status.conditions[0].lastTransitionTime}{"\n"}{end}'
}

delete_worker_pod() {
Expand Down
4 changes: 3 additions & 1 deletion kube/resources/pod-sweeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ data:
#!/bin/bash
get_worker_pods () {
kubectl -n ${KUBE_NAMESPACE} -L airbyte -l airbyte=worker-pod --field-selector status.phase!=Running get pods -o go-template --template '{{range .items}} {{.metadata.name}} {{.status.phase}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}'
kubectl -n ${KUBE_NAMESPACE} -L airbyte -l airbyte=worker-pod \
--field-selector status.phase!=Running get pods \
-o=jsonpath='{range .items[*]} {.metadata.name} {.status.phase} {.status.conditions[0].lastTransitionTime}{"\n"}{end}'
}
delete_worker_pod() {
Expand Down

0 comments on commit 77ea0e0

Please sign in to comment.