# yaml-language-server: $schema=../../api/jsonschema/harp.bundle.v1/Patch.json
apiVersion: harp.elastic.co/v1
kind: BundlePatch
meta:
  name: "service-account-deployer"
  owner: cluster-admin@elastic.co
  description: "Add a new cluster service account"
spec:
  rules:
  # Rule targets production and staging path
  - selector:
      matchPath:
        regex: "app/(production|staging)/observability/deployer/1.0.0/clusters/.*/.*/[0-9a-z]{32}/users"
    package:
      # Patch concerns secret data
      data:
        # We want to update a K/V couple
        kv:
          # Add an entry
          add:
            "{{ .Values.serviceAccountName }}": "{{ noSymbolPassword }}"
