apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: jmespath-with-special-chars-demo
spec:
  rules:
    - name: format-deploy-zone
      match:
        any:
          - resources:
              kinds:
                - Pod
      mutate:
        patchStrategicMerge:
          metadata:
            labels:
              deploy-zone: "{{ to_upper('{{@}}') }}"
    - name: retention-adjust
      match:
        any:
          - resources:
              kinds:
                - Pod
      mutate:
        patchStrategicMerge:
          metadata:
            labels:
              corp.com/retention: "{{ regex_replace_all('([0-9])([0-9])', '{{ @ }}', '${1}0') }}"
