From 7e61ac16a2b3f98d0ce1cad6794acfc73adffb17 Mon Sep 17 00:00:00 2001 From: Keith Suderman Date: Thu, 18 Apr 2024 11:50:40 -0400 Subject: [PATCH 1/2] Add enabled flag to the actions --- galaxy/templates/cronjob-maintenance.yaml | 4 ++++ galaxy/values.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/galaxy/templates/cronjob-maintenance.yaml b/galaxy/templates/cronjob-maintenance.yaml index 0ea57a5e..6b89135e 100644 --- a/galaxy/templates/cronjob-maintenance.yaml +++ b/galaxy/templates/cronjob-maintenance.yaml @@ -7,7 +7,11 @@ metadata: labels: {{- include "galaxy.labels" $ | nindent 4 }} spec: + {{- if $cronjob.enabled }} schedule: {{ $cronjob.schedule | quote }} + {{- else }} + schedule: "0 0 30 2 *" + {{- end }} jobTemplate: spec: template: diff --git a/galaxy/values.yaml b/galaxy/values.yaml index ba5e6f54..41700f5b 100644 --- a/galaxy/values.yaml +++ b/galaxy/values.yaml @@ -272,6 +272,7 @@ cronJobs: #- Runs the maintenance.sh script to purge items in the Galaxy database that #- have been flagged as deleted. maintenance: + enabled: true schedule: "5 2 * * *" extraSettings: #- Purge items older than this. @@ -287,6 +288,7 @@ cronJobs: - "{{ tpl .Values.cronJobs.maintenance.extraSettings.days $ }}" #- Remove files from the tmp directory that are older than the allowable wall time for a job tmpdir: + enabled: true schedule: "15 2 * * *" extraSettings: lastModified: '{{ index .Values "configs" "job_conf.yml" "runners" "k8s" "k8s_walltime_limit" | default 604800 }}' From bbdbdb9c18913146f935f05d090b0f67292516af Mon Sep 17 00:00:00 2001 From: Keith Suderman Date: Fri, 19 Apr 2024 16:19:09 -0400 Subject: [PATCH 2/2] Update galaxy/templates/cronjob-maintenance.yaml Co-authored-by: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com> --- galaxy/templates/cronjob-maintenance.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/galaxy/templates/cronjob-maintenance.yaml b/galaxy/templates/cronjob-maintenance.yaml index 6b89135e..d020b4f7 100644 --- a/galaxy/templates/cronjob-maintenance.yaml +++ b/galaxy/templates/cronjob-maintenance.yaml @@ -10,6 +10,8 @@ spec: {{- if $cronjob.enabled }} schedule: {{ $cronjob.schedule | quote }} {{- else }} + # Set an impossible date so that the cronjob is still defined, but effectively disabled. + # This will allow the cronjob to be run manually if needed. schedule: "0 0 30 2 *" {{- end }} jobTemplate: