#
# Copyright (C) 2019-2021 vdaas.org vald team <vald@vdaas.org>
#
# 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: valdhelmoperatorreleases.vald.vdaas.org
spec:
  group: vald.vdaas.org
  names:
    kind: ValdHelmOperatorRelease
    listKind: ValdHelmOperatorReleaseList
    plural: valdhelmoperatorreleases
    singular: valdhelmoperatorrelease
    shortNames:
      - vhor
      - vhors
  scope: Namespaced
  versions:
    - name: v1
      served: true
      storage: true
      subresources:
        status: {}
      additionalPrinterColumns:
        - name: Condition
          type: string
          jsonPath: .status.conditions[-1].type
          priority: 0
        - name: Age
          type: date
          jsonPath: .metadata.creationTimestamp
          priority: 0
      schema:
        openAPIV3Schema:
          description: ValdHelmOperatorRelease is the Schema for the valdhelmoperatorreleases API
          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 defines the observed state of ValdHelmOperatorRelease
              type: object
              x-kubernetes-preserve-unknown-fields: true
            # schema of spec must be generated by hack/helm/schema/crd/main.go.
            spec:
              type: object
              properties:
                affinity:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
                annotations:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
                enableLeaderElection:
                  type: boolean
                enableMetrics:
                  type: boolean
                healthPort:
                  type: integer
                image:
                  type: object
                  properties:
                    pullPolicy:
                      type: string
                      enum:
                        - Always
                        - Never
                        - IfNotPresent
                    repository:
                      type: string
                    tag:
                      type: string
                leaderElectionID:
                  type: string
                livenessProbe:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    failureThreshold:
                      type: integer
                    httpGet:
                      type: object
                      properties:
                        path:
                          type: string
                        port:
                          type: string
                        scheme:
                          type: string
                    initialDelaySeconds:
                      type: integer
                    periodSeconds:
                      type: integer
                    successThreshold:
                      type: integer
                    timeoutSeconds:
                      type: integer
                logging:
                  type: object
                  properties:
                    format:
                      type: string
                      enum:
                        - console
                        - json
                    level:
                      type: string
                      enum:
                        - debug
                        - info
                        - error
                    stacktraceLevel:
                      type: string
                      enum:
                        - debug
                        - info
                        - error
                maxConcurrentReconciles:
                  type: integer
                metricsPort:
                  type: integer
                name:
                  type: string
                namespaced:
                  type: boolean
                nodeSelector:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
                podAnnotations:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
                rbac:
                  type: object
                  properties:
                    create:
                      type: boolean
                    name:
                      type: string
                readinessProbe:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    failureThreshold:
                      type: integer
                    httpGet:
                      type: object
                      properties:
                        path:
                          type: string
                        port:
                          type: string
                        scheme:
                          type: string
                    initialDelaySeconds:
                      type: integer
                    periodSeconds:
                      type: integer
                    successThreshold:
                      type: integer
                    timeoutSeconds:
                      type: integer
                reconcilePeriod:
                  type: string
                replicas:
                  type: integer
                resources:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true
                service:
                  type: object
                  properties:
                    annotations:
                      type: object
                      x-kubernetes-preserve-unknown-fields: true
                    enabled:
                      type: boolean
                    externalTrafficPolicy:
                      type: string
                    labels:
                      type: object
                      x-kubernetes-preserve-unknown-fields: true
                    type:
                      type: string
                      enum:
                        - ClusterIP
                        - LoadBalancer
                        - NodePort
                serviceAccount:
                  type: object
                  properties:
                    create:
                      type: boolean
                    name:
                      type: string
                tolerations:
                  type: array
                  items:
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                watchNamespaces:
                  type: string
