apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
  name: 7799-policy
  namespace: policies
spec:
  remediationAction: enforce
  disabled: false
  policy-templates:
    - objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        metadata:
          name: 7799-policy-crd
        spec:
          severity: low
          object-templates:
          - complianceType: musthave
            objectDefinition:
              apiVersion: apiextensions.k8s.io/v1
              kind: CustomResourceDefinition
              metadata:
                name: mocklists.policy.open-cluster-management.io
              spec:
                group: policy.open-cluster-management.io
                names:
                  kind: MockList
                  listKind: MockListList
                  plural: mocklists
                  singular: mocklist
                scope: Namespaced
                versions:
                - name: v1
                  served: true
                  storage: true
                  schema:
                    openAPIV3Schema:
                      type: object
                      properties:
                        apiVersion:
                          type: string
                        kind:
                          type: string
                        metadata:
                          type: object
                        baselist:
                          type: array
                          items:
                            type: object
                            x-kubernetes-preserve-unknown-fields: true
    - extraDependencies:
      - apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        name: 7799-policy-crd
        compliance: Compliant
      objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        metadata:
          name: 7799-policy
        spec:
          severity: low
          object-templates:
          - complianceType: mustonlyhave
            objectDefinition:
              apiVersion: policy.open-cluster-management.io/v1
              kind: MockList
              metadata:
                name: 7799-test
                namespace: default
              baselist:
              - name: thing1
                data1: value1
              - name: thing2
                data2: value2
              - name: thing4
                data4: value4
