Skip to content

Commit

Permalink
tekton-ci: prune build-templates-e2e harder (#4168)
Browse files Browse the repository at this point in the history
* tekton-ci: prune build-templates-e2e harder

The cleanup-cronjob running in the tekton-ci namespace deletes
Applications used for e2e-tests. Currently, it deletes applications
at least 3 days old.

This doesn't seem to be enough to keep up with the rate of e2e-testing
in build-definitions anymore.

Remove applications after 1 day instead.

Signed-off-by: Adam Cmiel <[email protected]>

* tekton-ci: run cleanup-cronjob more often

Run hourly instead of daily. Currently, we're deleting e2e-tests
Applications after 1 day + up to 1 day. Let's make that "+ up to 1 hour"

Signed-off-by: Adam Cmiel <[email protected]>

---------

Signed-off-by: Adam Cmiel <[email protected]>
  • Loading branch information
chmeliik authored Jul 24, 2024
1 parent 49e73e3 commit 49281e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/tekton-ci/production/cleanup-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: CronJob
metadata:
name: cleanup-stale-resources
spec:
schedule: "0 1 * * *" #Daily at 01:00
schedule: "0 * * * *" # hourly
jobTemplate:
spec:
template:
Expand All @@ -17,7 +17,7 @@ spec:
- -c
- |
date; echo Cleaning up the stale applications
oc get application -n build-templates-e2e -o go-template --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' | awk '$2 <= "'$(date -d'now-3 days' --iso-8601=seconds --utc | sed 's/+00:00/Z/')'" { print $1 }' | xargs --no-run-if-empty oc delete application -n build-templates-e2e
oc get application -n build-templates-e2e -o go-template --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' | awk '$2 <= "'$(date -d '1 day ago' --iso-8601=seconds --utc | sed 's/+00:00/Z/')'" { print $1 }' | xargs --no-run-if-empty oc delete application -n build-templates-e2e
resources:
limits:
cpu: 100m
Expand Down

0 comments on commit 49281e4

Please sign in to comment.