apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition

metadata:
  name: networks.knap.github.com

spec:
  group: knap.github.com
  names:
    singular: network
    plural: networks
    kind: Network
    listKind: NetworkList
    shortNames:
    - nw
    categories:
    - all # will appear in "kubectl get all"
  scope: Namespaced
  versions:
  - name: v1alpha1
    served: true
    storage: true # one and only one version must be marked with storage=true
    subresources: # requires CustomResourceSubresources feature gate enabled
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        required: [ spec ]
        properties:
          spec:
            type: object
            required: [ provider ]
            properties:
              provider:
                type: string
              hints:
                type: object
                nullable: true
                additionalProperties:
                  type: string
          status:
            type: object
            properties:
              networkAttachmentDefinitions:
                type: array
                nullable: true
                items:
                  type: string
              deployments:
                type: array
                nullable: true
                items:
                  type: string
