# Copyright 2020 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: serviceexports.multicluster.x-k8s.io
spec:
  group: multicluster.x-k8s.io
  scope: Namespaced
  names:
    plural: serviceexports
    singular: serviceexport
    kind: ServiceExport
    shortNames:
    - svcex
  versions:
  - name: v1alpha1
    served: true
    storage: true
    subresources:
      status: {}
    additionalPrinterColumns:
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
    "schema":
      "openAPIV3Schema":
        description: ServiceExport declares that the Service with the same name and
          namespace as this export should be consumable from other clusters.
        type: object
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          status:
            description: status describes the current state of an exported service.
              Service configuration comes from the Service that had the same name
              and namespace as this ServiceExport. Populated by the multi-cluster
              service implementation's controller.
            type: object
            properties:
              conditions:
                type: array
                items:
                  description: "ServiceExportCondition contains details for the current
                    condition of this service export. \n Once [KEP-1623](https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1623-standardize-conditions)
                    is implemented, this will be replaced by metav1.Condition."
                  type: object
                  required:
                  - status
                  - type
                  properties:
                    lastTransitionTime:
                      type: string
                      format: date-time
                    message:
                      type: string
                    reason:
                      type: string
                    status:
                      description: Status is one of {"True", "False", "Unknown"}
                      type: string
                      enum:
                      - "True"
                      - "False"
                      - Unknown
                    type:
                      description: ServiceExportConditionType identifies a specific
                        condition.
                      type: string
                x-kubernetes-list-map-keys:
                - type
                x-kubernetes-list-type: map
