apiVersion: batch/v1
kind: Job
metadata:
  name: "1.7.0-upgrade"
spec:
  template:
    spec:
      imagePullSecrets:
        - name: qn-registry-secret
      restartPolicy: Never
      containers:
        - name: post-upgrade-job
          image: ccr.ccs.tencentyun.com/koderover-rc/ua:1.7.0-amd64
          imagePullPolicy: Always
          resources:
            requests:
              cpu: 200m
              memory: 512Mi
            limits:
              cpu: 200m
              memory: 512Mi
          args:
            - "migrate"
            - "-c"
            - "mongodb://zadig-mongodb:27017"
            - "-d"
            - "zadig"
            - "-f"
            - "1.6.0"
            - "-t"
            - "1.7.0"
          env:
            - name: SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: zadig-aes-key
                  key: aesKey
            - name: ADDRESS
              value: {{ default "http" .Values.protocol }}://{{- include "zadig.endpoint" . }}
