apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: globaldeploymentpolicies.amko.vmware.com
spec:
  conversion:
    strategy: None
  group: amko.vmware.com
  names:
    kind: GlobalDeploymentPolicy
    listKind: GlobalDeploymentPolicyList
    plural: globaldeploymentpolicies
    shortNames:
    - gdp
    singular: globaldeploymentpolicy
  scope: Namespaced
  versions:
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              matchClusters:
                type: array
                items:
                  type: string
                  # object:
                  #   type: string
              matchRules:
                type: object
                properties:
                  appSelector:
                    type: object
                    properties:
                      label:
                        additionalProperties:
                          type: string
                        type: object
                  namespaceSelector:
                    type: object
                    properties:
                      label:
                        additionalProperties:
                          type: string
                        type: object
              trafficSplit:
                items:
                  type: object
                  properties:
                    cluster:
                      type: string
                    weight:
                      type: integer
                type: array
          status:
            type: "object"
            properties:
              errorStatus:
                type: "string"
        required:
        - spec
    served: true
    storage: true
