apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: constraints.bridgekeeper.maibornwolff.de
spec:
  group: bridgekeeper.maibornwolff.de
  versions:
    - name: v1alpha1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                target:
                  type: object
                  properties:
                    matches:
                      type: array
                      minItems: 1
                      items:
                        type: object
                        properties:
                          apiGroup: 
                            type: string
                          kind: 
                            type: string
                    namespaces:
                      type: array
                      items:
                        type: string
                    excludedNamespaces:
                      type: array
                      items:
                        type: string
                rule:
                  type: object
                  properties:
                    python:
                      type: string
  scope: Cluster
  names:
    plural: constraints
    singular: constraint
    kind: Constraint
    shortNames:
      - constr
      - con
