apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: namespaceresourcesinjectors.blakelead.com
spec:
  group: blakelead.com
  scope: Cluster
  names:
    plural: namespaceresourcesinjectors
    singular: namespaceresourcesinjector
    kind: NamespaceResourcesInjector
    shortNames: [nsri, nri]
  versions:
    - name: v1alpha1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          description: 'NamespaceResourcesInjector describes the resources that the controller will inject in specified namespaces.'
          type: object
          properties:
            spec:
              type: object
              properties:
                namespaces:
                  description: 'Namespaces is a list of namespaces names or regex that will be matched to be injected.'
                  type: array
                  items:
                    type: string
                excludedNamespaces:
                  description: 'Namespaces is a list of namespaces names or regex that will be excluded to be injected.'
                  type: array
                  items:
                    type: string
                resources:
                  description: 'Resources is the map of resources to be injected.'
                  type: array
                  items:
                    type: string
            status:
              type: object
              properties:
                injectedNamespaces:
                  description: 'InjectedNamespaces is a list of namespaces this injector injected its resources in.'
                  type: array
                  items:
                    type: string
      additionalPrinterColumns:
        - name: InjectedNamespaces
          type: string
          description: 'The list of namespaces injected by the resources specified by this injector.'
          jsonPath: .status.injectedNamespaces
        - name: Age
          type: date
          jsonPath: .metadata.creationTimestamp
