apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: adjustments.criresmgr.intel.com
spec:
  group: criresmgr.intel.com
  names:
    kind: Adjustment
    singular: adjustment
    plural: adjustments
  scope: Namespaced
  versions:
    - name: v1alpha1
      served: true
      storage: true
      schema:
        # openAPI V3 Schema for validating adjustments
        openAPIV3Schema:
          type: object
          required: [ spec ]
          properties:
            spec:
              type: object
              required: [ scope ]
              properties:
                scope:
                  type: array
                  items:
                    type: object
                    properties:
                      nodes:
                        type: array
                        items:
                          type: string
                      containers:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                            operator:
                              type: string
                            values:
                              type: array
                              items:
                                type: string
                resources:
                  type: object
                  properties:
                    requests:
                      type: object
                      properties:
                        cpu:
                          type: string
                        memory:
                          type: string
                    limits:
                      type: object
                      properties:
                        cpu:
                          type: string
                        memory:
                          type: string
                classes:
                  type: object
                  properties:
                    rdt:
                      type: string
                    blockio:
                      type: string
                toptierLimit:
                  type: string
            status:
              type: object
              properties:
                nodes:
                  type: object
                  additionalProperties:
                    type: object
                    properties:
                      errors:
                        type: object
                        additionalProperties:
                          type: string
