apiVersion: batch/v1
kind: Job
metadata:
  name: 1.15.0-upgrade
spec:
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: post-upgrade-job
          image: koderover.tencentcloudcr.com/koderover-public/ua:1.15.0
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 200m
              memory: 512Mi
            limits:
              cpu: 200m
              memory: 512Mi
          args:
            - "migrate"
            - "-c"
            - "mongodb://root:zadig@kr-mongodb:27017"
            - "-d"
            - "zadig"
            - "-f"
            - "1.14.0"
            - "-t"
            - "1.15.0"
          env:
            - name: SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: zadig-aes-key
                  key: aesKey
            - name: ADDRESS
              value: {{ default "http" .Values.protocol }}://{{- include "zadig.endpoint" . }}
