---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.17.3
  name: symphonies.eno.azure.io
spec:
  group: eno.azure.io
  names:
    kind: Symphony
    listKind: SymphonyList
    plural: symphonies
    singular: symphony
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: |-
          Symphony is a set of variations on a composition.
          Useful for creating several compositions that use a common set of bindings but different synthesizers.

          This pattern is highly opinionated for use-cases in which a single "unit of management"
          includes multiple distinct components. For example: deploying many instances of an application that
          is comprised of several components (Wordpress, etc.).
        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:
            properties:
              bindings:
                description: Bindings are inherited by all compositions managed by
                  this symphony.
                items:
                  description: |-
                    Bindings map a specific Kubernetes resource to a ref exposed by a synthesizer.
                    Compositions use bindings to populate inputs supported by their synthesizer.
                  properties:
                    key:
                      description: Key determines which ref this binding binds to.
                        Opaque.
                      type: string
                    resource:
                      description: A reference to a specific resource name and optionally
                        namespace.
                      properties:
                        name:
                          type: string
                        namespace:
                          type: string
                      required:
                      - name
                      type: object
                  required:
                  - key
                  - resource
                  type: object
                type: array
              synthesisEnv:
                description: |-
                  SynthesisEnv
                  Copied opaquely into the compositions managed by this symphony.
                items:
                  properties:
                    name:
                      maxLength: 100
                      type: string
                    value:
                      type: string
                  required:
                  - name
                  type: object
                maxItems: 50
                type: array
              variations:
                description: |-
                  Each variation will result in the creation of a composition.
                  Synthesizer refs must be unique across variations.
                  Removing a variation will cause the composition to be deleted!
                items:
                  properties:
                    annotations:
                      additionalProperties:
                        type: string
                      description: Used to populate the composition's medatada.annotations.
                      type: object
                    bindings:
                      description: |-
                        Variation-specific bindings get merged with Symphony bindings and take
                        precedence over them.
                      items:
                        description: |-
                          Bindings map a specific Kubernetes resource to a ref exposed by a synthesizer.
                          Compositions use bindings to populate inputs supported by their synthesizer.
                        properties:
                          key:
                            description: Key determines which ref this binding binds
                              to. Opaque.
                            type: string
                          resource:
                            description: A reference to a specific resource name and
                              optionally namespace.
                            properties:
                              name:
                                type: string
                              namespace:
                                type: string
                            required:
                            - name
                            type: object
                        required:
                        - key
                        - resource
                        type: object
                      type: array
                    labels:
                      additionalProperties:
                        type: string
                      description: Used to populate the composition's metadata.labels.
                      type: object
                    synthesisEnv:
                      description: |-
                        SynthesisEnv
                        Copied opaquely into the compositions that's derived from this variation.
                        It gets merged with the Symhony environment and takes precedence over it.
                      items:
                        properties:
                          name:
                            maxLength: 100
                            type: string
                          value:
                            type: string
                        required:
                        - name
                        type: object
                      maxItems: 25
                      type: array
                    synthesizer:
                      description: Used to populate the composition's spec.synthesizer.
                      properties:
                        name:
                          type: string
                      type: object
                  type: object
                type: array
            type: object
          status:
            properties:
              observedGeneration:
                format: int64
                type: integer
              ready:
                format: date-time
                type: string
              reconciled:
                format: date-time
                type: string
              synthesized:
                format: date-time
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
