Skip to content

Commit 7d802c5

Browse files
committed
fix: running ir shold not be removed
this PR fixes the case where a running IR is wrongly removed due to the missing completionTime field, that is only added after finishing the IR run. Signed-off-by: Leandro Mendes <[email protected]>
1 parent 828aff9 commit 7d802c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/release/base/cronjobs/remove-internal-requests.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ spec:
3131
YD=$(date -d 'yesterday' +%s)
3232
kubectl get internalrequests --all-namespaces \
3333
--sort-by=.status.completionTime \
34-
--template '{{range .items}}{{.metadata.name}}{{"\t"}}{{.metadata.namespace}}{{"\t"}}{{.status.completionTime}}{{"\n"}}{{end}}' > $KUBECTL_OUTPUT
34+
--template '{{range .items}}{{.metadata.name}}{{"\t"}}{{.metadata.namespace}}{{"\t"}}{{.status.completionTime}}{{"\n"}}{{end}}' \
35+
| grep -E "[0-9]{4}((-?)[0-9]{2})+T.*Z$" > $KUBECTL_OUTPUT
3536
awk -v yesterday=${YD} '{
3637
# parsing the completionTime and converting it to epoch
3738
# so we can compute the precise IRs that should be deleted

0 commit comments

Comments
 (0)