# Copyright 2020 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: servicebindingprojections.internal.service.binding
  annotations:
    controller-gen.kubebuilder.io/version: v0.3.0
  labels:
    bindings.labs.vmware.com/release: devel
    bindings.labs.vmware.com/crd-install: "true"
    duck.knative.dev/binding: "true"
spec:
  group: internal.service.binding
  names:
    kind: ServiceBindingProjection
    listKind: ServiceBindingProjectionList
    plural: servicebindingprojections
    singular: servicebindingprojection
    categories:
    - bind
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .status.conditions[?(@.type=="Ready")].status
      name: Ready
      type: string
    - jsonPath: .status.conditions[?(@.type=="Ready")].reason
      name: Reason
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    name: v1alpha2
    schema:
      openAPIV3Schema:
        description: ServiceBindingProjection is the Schema for the servicebindingprojections
          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: ServiceBindingProjectionSpec defines the desired state of
              ServiceBindingProjection
            properties:
              application:
                description: Application is a reference to an object that fulfills
                  the PodSpec duck type
                properties:
                  apiVersion:
                    description: API version of the referent.
                    type: string
                  containers:
                    description: Containers describes which containers in a Pod should
                      be bound to
                    items:
                      anyOf:
                      - type: integer
                      - type: string
                      x-kubernetes-int-or-string: true
                    type: array
                  kind:
                    description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
                    type: string
                  name:
                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
                    type: string
                  selector:
                    description: Selector is a query that selects the application
                      or applications to bind the service to
                    properties:
                      matchExpressions:
                        description: matchExpressions is a list of label selector
                          requirements. The requirements are ANDed.
                        items:
                          description: A label selector requirement is a selector
                            that contains values, a key, and an operator that relates
                            the key and values.
                          properties:
                            key:
                              description: key is the label key that the selector
                                applies to.
                              type: string
                            operator:
                              description: operator represents a key's relationship
                                to a set of values. Valid operators are In, NotIn,
                                Exists and DoesNotExist.
                              type: string
                            values:
                              description: values is an array of string values. If
                                the operator is In or NotIn, the values array must
                                be non-empty. If the operator is Exists or DoesNotExist,
                                the values array must be empty. This array is replaced
                                during a strategic merge patch.
                              items:
                                type: string
                              type: array
                          required:
                          - key
                          - operator
                          type: object
                        type: array
                      matchLabels:
                        additionalProperties:
                          type: string
                        description: matchLabels is a map of {key,value} pairs. A
                          single {key,value} in the matchLabels map is equivalent
                          to an element of matchExpressions, whose key field is "key",
                          the operator is "In", and the values array contains only
                          "value". The requirements are ANDed.
                        type: object
                    type: object
                required:
                - apiVersion
                - kind
                type: object
              binding:
                description: Binding is the projected secret for this ServiceBindingProjection.
                properties:
                  name:
                    description: 'Name of the referent secret. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
                    type: string
                required:
                - name
                type: object
              env:
                description: EnvVars is the collection of mappings from Secret entries
                  to environment variables
                items:
                  description: ServiceBindingProjectionEnvVar defines a mapping from
                    the value of a Secret entry to an environment variable
                  properties:
                    key:
                      description: Key is the key in the Secret that will be exposed
                      type: string
                    name:
                      description: Name is the name of the environment variable
                      type: string
                  required:
                  - key
                  - name
                  type: object
                type: array
              name:
                description: Name is the name of the service as projected into the
                  application container.
                type: string
            required:
            - application
            - binding
            - name
            type: object
          status:
            description: ServiceBindingProjectionStatus defines the observed state
              of ServiceBindingProjection
            properties:
              conditions:
                description: Conditions are the conditions of this ServiceBindingProjection
                items:
                  description: ServiceBindingProjectionCondition contains details
                    for the current condition of this ServiceBindingProjection
                  properties:
                    lastTransitionTime:
                      description: Last time the condition transitioned from one status
                        to another
                      format: date-time
                      type: string
                    message:
                      description: Human-readable message indicating details about
                        last transition
                      type: string
                    reason:
                      description: Unique, one-word, CamelCase reason for the condition's
                        last transition
                      type: string
                    status:
                      description: Status is the status of the condition Can be True,
                        False, Unknown.
                      type: string
                    type:
                      description: Type is the type of the condition
                      type: string
                  required:
                  - status
                  - type
                  type: object
                type: array
              observedGeneration:
                description: ObservedGeneration is the 'Generation' of the ServiceBindingProjection
                  that was last processed by the controller.
                format: int64
                type: integer
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
