apiVersion: v1
kind: Namespace
metadata:
  name: pol-clone-sync-delete-source
---
apiVersion: v1
data:
  foo: YmFy
kind: Secret
metadata:
  name: regcred
  namespace: pol-clone-sync-delete-source
type: Opaque
---
apiVersion: kyverno.io/v2beta1
kind: Policy
metadata:
  name: pol-clone-sync-delete-source
  namespace: pol-clone-sync-delete-source
spec:
  rules:
  - name: pol-clone-sync-delete-source-secret
    match:
      any:
      - resources:
          kinds:
          - ConfigMap
    generate:
      apiVersion: v1
      kind: Secret
      name: newsecret
      namespace: pol-clone-sync-delete-source
      synchronize: true
      clone:
        namespace: pol-clone-sync-delete-source
        name: regcred
