1
0
mirror of https://github.com/appuio/appuio-pruner.git synced 2026-02-05 09:45:36 +01:00

Individual cronjobs can be disabled

This commit is contained in:
Sandro Kaspar
2020-06-08 13:48:43 +02:00
parent 7a9f84952e
commit c00c5ee2a1
3 changed files with 14 additions and 1 deletions

View File

@@ -24,9 +24,10 @@ and role bindings for the jobs to do their job.
| Name | Default value | Description |
|------|---------------|-------------|
| appuio_pruner_namespace | `appuio-infra` | Namespace to install the APPUiO pruner into |
| appuio_pruner_namespace | `appuio-pruner` | Namespace to install the APPUiO pruner into |
| appuio_pruner_image | `"docker.io/appuio/oc:{{ openshift_release }}"` | Image for the pruner job |
| appuio_pruner_schedule | `@hourly` | Schedule in [Cron] format |
| appuio_pruner_disabled_jobs | `[]` | List of pruner jobs to be disabled |
| appuio_pruner_extra_args_<kind> | `[]` | List of extra args to add to a prune command. See below |
| appuio_pruner_state | `present` | When set to `absent`, the pruner is removed from the cluster |

View File

@@ -11,6 +11,8 @@ appuio_pruner_cmd:
- adm
- prune
appuio_pruner_disabled_jobs: []
appuio_pruner_args:
builds:
- builds

View File

@@ -28,6 +28,7 @@
- builds
- deployments
- images
when: item not in appuio_pruner_disabled_jobs
vars:
cmd: >-
{{
@@ -49,6 +50,15 @@
MEMORY_REQUEST: "{{ appuio_pruner_memory_request }}"
MEMORY_LIMIT: "{{ appuio_pruner_memory_limit }}"
- name: Remove disabled cronjobs
with_list: "{{ appuio_pruner_disabled_jobs }}"
command: >-
oc -n {{ appuio_pruner_namespace | quote }}
delete cronjob "prune-{{ item }}"
--ignore-not-found
register: r_remove_cronjob
changed_when: r_remove_cronjob.stdout == "cronjob.batch \"prune-{{ item }}\" deleted"
always:
- name: Delete temp directory
file: