apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: caches.infinispan.org
  labels:
    name: infinispan-operator
spec:
  group: infinispan.org
  names:
    kind: Cache
    listKind: CacheList
    plural: caches
    singular: cache
  scope: Namespaced
  versions:
    - name: v2alpha1
      schema:
        openAPIV3Schema:
          description: Cache is the Schema for the caches API
          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
            spec:
              description: CacheSpec defines the desired state of Cache
              properties:
                adminAuth:
                  description: Deprecated. This no longer has any effect. The operator's admin credentials are now used to perform cache operations
                  properties:
                    password:
                      description: Secret and key containing the admin password for authentication.
                      properties:
                        key:
                          description: The key of the secret to select from.  Must be a valid secret key.
                          type: string
                        name:
                          description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?'
                          type: string
                        optional:
                          description: Specify whether the Secret or its key must be defined
                          type: boolean
                      required:
                        - key
                      type: object
                    secretName:
                      description: name of the secret containing both admin username and password
                      type: string
                    username:
                      description: Secret and key containing the admin username for authentication.
                      properties:
                        key:
                          description: The key of the secret to select from.  Must be a valid secret key.
                          type: string
                        name:
                          description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?'
                          type: string
                        optional:
                          description: Specify whether the Secret or its key must be defined
                          type: boolean
                      required:
                        - key
                      type: object
                  type: object
                clusterName:
                  description: Name of the cluster where to create the cache
                  type: string
                name:
                  description: Name of the cache to be created. If empty ObjectMeta.Name will be used
                  type: string
                template:
                  description: Cache template in XML format
                  type: string
                templateName:
                  description: Name of the template to be used to create this cache
                  type: string
              required:
                - clusterName
              type: object
            status:
              description: CacheStatus defines the observed state of Cache
              properties:
                conditions:
                  description: Conditions list for this cache
                  items:
                    description: CacheCondition define a condition of the cluster
                    properties:
                      message:
                        description: Human-readable message indicating details about last transition.
                        type: string
                      status:
                        description: Status is the status of the condition.
                        type: string
                      type:
                        description: Type is the type of the condition.
                        type: string
                    required:
                      - status
                      - type
                    type: object
                  type: array
                serviceName:
                  description: Service name that exposes the cache inside the cluster
                  type: string
              type: object
          type: object
      served: true
      storage: true
      subresources:
        status: {}
