apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: charlesroutes.charlescd.io
spec:
  group: charlescd.io
  versions:
    - name: v1
      served: true
      storage: true
      subresources:
        status: {}
      schema:
        openAPIV3Schema:
          type: object
          required: ["spec"]
          properties:
            spec:
              type: object
              required: ["circles"]
              properties:
                circles:
                  type: array
                  items:
                    type: object
                    required:
                    - id
                    - default
                    - components
                    properties:
                      id:
                        type: string
                      default:
                        type: boolean
                      components:
                        type: array
                        items:
                          type: object
                          required: ["name", "tag"]
                          properties:
                            name:
                              type: string
                            tag:
                              type: string

  names:
    kind: CharlesRoutes
    plural: charlesroutes
    singular: charlesroute
  scope: Cluster