apiVersion: batch/v1
kind: Job
metadata:
  name: minio-config-generator
spec:
  template:
    spec:
      imagePullSecrets:
      - name: hpe-imagepull-secrets
      serviceAccountName: minio-config-generator
      containers:
        - name: script
          image: kubernetes-python
          imagePullPolicy: IfNotPresent
          command: ["python3"]
          args:
            - "/mnt/minio-config-generator/entrypoint.py"
          volumeMounts:
            - mountPath: /mnt/minio-config-generator
              name: minio-config-generator
          env:
            - name: EXTERNAL_MINIO_CONFIG_SECRET_NAME
              value: "$(externalMinioConfigSecretName)"
            - name: EXTERNAL_MINIO_CONFIG_SECRET_NAMESPACE
              value: "$(externalMinioConfigSecretNamespace)"
      volumes:
        - name: minio-config-generator
          configMap:
            name: minio-config-generator
      restartPolicy: Never
