apiVersion: batch/v1
kind: Job
metadata:
  name: "pre-install"
  annotations:
    "helm.sh/hook": pre-install
    "helm.sh/hook-weight": "1"
    "helm.sh/hook-delete-policy": hook-succeeded
spec:
  template:
    metadata:
      name: "pre-upgrade-hook2"
    spec:
      restartPolicy: Never
      containers:
      - name: {{ .Chart.Name }}-generate-mnemonic
        {{ include "common.containers.imageConfig" .Values.image | nindent 8 }}
        volumeMounts:{{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 10 }}

          - name: generate-mnemonic-configmap
            mountPath: /generate_entrypoint.sh
            readOnly: true
            subPath: entrypoint.sh
        command:
          - "/generate_entrypoint.sh"
      volumes:  {{- include "common.storage.configureAppVolumes" .Values | nindent 8 -}}
        - name: generate-mnemonic-configmap
          configMap:
            defaultMode: 0700
            name: "generate-mnemonic-config-map"
