apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    helm.sh/hook: post-upgrade
    helm.sh/hook-delete-policy: before-hook-creation
  name: rootfs-patcher
spec:
  template:
    spec:
      containers:
      - name: patch
        command:
        - /rootfs-patcher
        - --namespace={{ .Values.opi.namespace }}
        - --rootfs-version={{ .Values.opi.rootfs_version }}
        - --timeout={{ .Values.opi.rootfs_patcher_timeout }}
        image: eirini/rootfs-patcher:{{ .Values.opi.image_tag }}
        imagePullPolicy: IfNotPresent
      restartPolicy: OnFailure
      serviceAccount: opi
      serviceAccountName: opi
