apiVersion: v1
kind: Namespace
metadata:
  name: cpol-clone-sync-update-trigger-no-match-ns
---
apiVersion: v1
data:
  foo: YmFy
kind: Secret
metadata:
  name: source-secret
  namespace: cpol-clone-sync-update-trigger-no-match-ns
type: Opaque
---
apiVersion: kyverno.io/v2beta1
kind: ClusterPolicy
metadata:
  name: cpol-clone-sync-update-trigger-no-match-policy
spec:
  rules:
  - name: clone-secret
    match:
      any:
      - resources:
          kinds:
          - ConfigMap
          selector:
            matchLabels:
              create-secret: "true"
    generate:
      apiVersion: v1
      kind: Secret
      name: downstream-secret
      namespace: "{{request.object.metadata.namespace}}"
      synchronize: true
      clone:
        namespace: cpol-clone-sync-update-trigger-no-match-ns
        name: source-secret