apiVersion: batch/v1
kind: Job
metadata:
  name: test-app-job-secrets-static
  namespace: default
spec:
  backoffLimit: 1
  template:
    metadata:
      annotations:
        ovai.asaintsever.org/inject: "true"
        ovai.asaintsever.org/secrets-type: "static" # static secrets
        # When dealing with static secrets: no need to enable 'job' mode. For this test, we explicitly declare it.
        ovai.asaintsever.org/mode: "job"
      labels:
        com.ovai.application: test
        com.ovai.service: test-app-svc
    spec:
      restartPolicy: Never
      # When dealing with static secrets: no need for a custom serviceAccountName 
      serviceAccountName: default
      containers:
        - name: test-app-job-secrets-static-container
          image: busybox:1.28
          command:
            - "sh"
            - "-c"
            - |
              set -e
              echo "Job started"
              echo "I am a job... still working - 1"
              cat /another-custom-folder/secrets.properties
              sleep 5
              echo "I am a job... still working - 2"
              cat /another-custom-folder/secrets.properties
              sleep 5
              echo "I am a job... still working - 3"
              cat /another-custom-folder/secrets.properties
              sleep 5
              echo "I am a job... still working - 4"
              cat /another-custom-folder/secrets.properties
              sleep 5
              echo "I am a job... still working - 5"
              cat /another-custom-folder/secrets.properties
              echo "Job stopped"
          volumeMounts:
            - name: secrets
              mountPath: /another-custom-folder
      volumes:
        - name: secrets
          emptyDir:
            medium: Memory