apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: sdx-collate
spec:
  schedule: 0 6 * * 1-5
  suspend: false
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: sdx-collate
            image: eu.gcr.io/{{ .Values.registry_location }}/sdx-collate:{{ .Chart.AppVersion }}
            imagePullPolicy: Always
            args:
            - /bin/sh
            - -c
            - python run.py
            env:
            - name: PROJECT_ID
              valueFrom: 
                configMapKeyRef:
                  name: sdx-config
                  key: project_id
            - name: LOGGING_LEVEL
              valueFrom: 
                configMapKeyRef:
                  name: sdx-config          
                  key: logging_level
          restartPolicy: OnFailure
          serviceAccountName: sdx-workload-identity
  successfulJobsHistoryLimit: 1
