From f79d5d143ee5dce13d6a90b9b9a8b7f68df3254c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mon, 16 Dec 2019 14:28:35 +0100 Subject: [PATCH] distgit-bz: move from one cron job to two This will allow to run one with email enabled and thus notifying users if their account is wrongly configured. The other run will be with email disabled, thus notifying only the admins (in this case: Kevin and I) about mis-configurations. Signed-off-by: Pierre-Yves Chibon --- .../distgit-bugzilla-sync/files/cron.yml | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/roles/openshift-apps/distgit-bugzilla-sync/files/cron.yml b/roles/openshift-apps/distgit-bugzilla-sync/files/cron.yml index 10047ee9c6..c3ed838539 100644 --- a/roles/openshift-apps/distgit-bugzilla-sync/files/cron.yml +++ b/roles/openshift-apps/distgit-bugzilla-sync/files/cron.yml @@ -1,12 +1,49 @@ apiVersion: batch/v1beta1 kind: CronJob metadata: - name: distgit-bugzilla-sync + name: distgit-bugzilla-sync-email spec: successfulJobsHistoryLimit: 3 failedJobsHistoryLimit: 1 concurrencyPolicy: Forbid - schedule: "35 */4 * * *" + schedule: "35 2 * * *" + startingDeadlineSeconds: 500 + jobTemplate: + spec: + template: + metadata: + labels: + parent: "cronjobdistgit-bugzilla-sync" + spec: + hostAliases: + - hostnames: + - partner-bugzilla.redhat.com + ip: 209.132.183.72 + containers: + - name: distgit-bugzilla-sync + image: docker-registry.default.svc:5000/distgit-bugzilla-sync/distgit-bugzilla-sync:latest + command: ["/usr/local/bin/distgit-bugzilla-sync", "--debug", + "--add-config-file=/etc/distgit-bugzilla-sync/configuration.toml"] + volumeMounts: + - name: config-volume + mountPath: /etc/distgit-bugzilla-sync + readOnly: true + restartPolicy: Never + volumes: + - name: config-volume + configMap: + defaultMode: 420 + name: distgit-bugzilla-sync-configmap +-- +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + name: distgit-bugzilla-sync-nomail +spec: + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 1 + concurrencyPolicy: Forbid + schedule: "35 14 * * *" startingDeadlineSeconds: 500 jobTemplate: spec: