# Copyright 2019 waveywaves
#
# 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
#
#     https://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: cloudeventsinks.cloudevents.waveywaves.dev
  labels:
    cloudevents.waveywaves.dev/release: devel
    knative.dev/crd-install: "true"
spec:
  group: cloudevents.waveywaves.dev
  versions:
    - name: v1alpha1
      served: true
      storage: true
      subresources:
        status: { }
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              description: Spec holds the desired state of the cloudeventsink (from the client).
              type: object
              properties:
                image:
                  type: string
                replicas:
                  type: integer
                  format: int32
            status:
              description: Status communicates the observed state of the cloudeventsink (from the controller).
              type: object
              properties:
                annotations:
                  description: Annotations is additional Status fields for the Resource to save some additional State as well as convey more information to the user. This is roughly akin to Annotations on any k8s resource, just the reconciler conveying richer information outwards.
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
                conditions:
                  description: Conditions the latest available observations of a resource's current state.
                  type: array
                  items:
                    type: object
                observedGeneration:
                  description: ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.
                  type: integer
                  format: int64
                readyReplicas:
                  type: integer
                  format: int32
      additionalPrinterColumns:
        - name: Ready
          type: string
          jsonPath: ".status.conditions[?(@.type=='Ready')].status"
        - name: Reason
          type: string
          jsonPath: ".status.conditions[?(@.type=='Ready')].reason"
  names:
    kind: CloudeventSink
    plural: cloudeventsinks
    singular: cloudeventsink
    categories:
    - all
    - knative
    shortNames:
    - cesink
  scope: Namespaced

