---
apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    helm.sh/hook: post-upgrade
    helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded,hook-failed
    helm.sh/hook-weight: "200"
  labels:
    app.kubernetes.io/component: hooks
    app.kubernetes.io/instance: kyverno
    app.kubernetes.io/part-of: kyverno
    app.kubernetes.io/version: 3.4.1
  name: kyverno-migrate-resources
  namespace: kyverno
spec:
  backoffLimit: 2
  template:
    metadata: null
    spec:
      containers:
        - args:
            - migrate
            - --resource
            - cleanuppolicies.kyverno.io
            - --resource
            - clustercleanuppolicies.kyverno.io
            - --resource
            - clusterpolicies.kyverno.io
            - --resource
            - globalcontextentries.kyverno.io
            - --resource
            - policies.kyverno.io
            - --resource
            - policyexceptions.kyverno.io
            - --resource
            - updaterequests.kyverno.io
          image: ghcr.io/kyverno/kyverno-cli:v1.14.1
          imagePullPolicy: IfNotPresent
          name: kubectl
          resources:
            limits:
              cpu: 100m
              memory: 256Mi
            requests:
              cpu: 10m
              memory: 64Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            privileged: false
            readOnlyRootFilesystem: true
            runAsGroup: 65534
            runAsNonRoot: true
            runAsUser: 65534
            seccompProfile:
              type: RuntimeDefault
      restartPolicy: Never
      serviceAccountName: kyverno-migrate-resources
