apiVersion: batch/v1
kind: Job
metadata:
  name: ca-certificates-(( random.String 5 "[a-z]" ))
spec:
  backoffLimit: 4
  template:
    spec:
      containers:
        - name: certs
          image: qlik-docker-qsefe.bintray.io/edge-auth:2.57.1
          imagePullPolicy: IfNotPresent
          command: ["/bin/sh","-c"]
          args: ["cp /etc/ssl/certs/ca-certificates.crt /mnt/certs/ca-certificates.crt; $(CERTS_COMMAND)"]
          env:
            - name: CERTS_COMMAND
              valueFrom:
                configMapKeyRef:
                  key: caCommand
                  name: configs
            - name: CUSTOM_CERTS
              valueFrom:
                secretKeyRef:
                  key: caCertificates
                  name: secrets
          volumeMounts:
            - name: ca-certificates
              mountPath: "/mnt/certs"
      restartPolicy: Never
      imagePullSecrets:
      - name: artifactory-docker-secret
      volumes:
        - name: ca-certificates
          persistentVolumeClaim:
            claimName: ca-certificates
