apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: tiertemplates.toolchain.dev.openshift.com
spec:
  group: toolchain.dev.openshift.com
  names:
    kind: TierTemplate
    listKind: TierTemplateList
    plural: tiertemplates
    singular: tiertemplate
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.type
      name: Type
      type: string
    - jsonPath: .spec.revision
      name: Revision
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: TierTemplate is the Schema for the tiertemplates 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: TierTemplateSpec defines the desired state of TierTemplate
            properties:
              revision:
                description: The revision of the corresponding template
                type: string
              template:
                description: Template contains an OpenShift Template to be used to
                  provision either a user's namespace or cluster-wide resources
                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
                  labels:
                    additionalProperties:
                      type: string
                    description: labels is a optional set of labels that are applied
                      to every object during the Template to Config transformation.
                    type: object
                  message:
                    description: message is an optional instructional message that
                      will be displayed when this template is instantiated. This field
                      should inform the user how to utilize the newly created resources.
                      Parameter substitution will be performed on the message before
                      being displayed so that generated credentials and other parameters
                      can be included in the output.
                    type: string
                  metadata:
                    type: object
                  objects:
                    description: objects is an array of resources to include in this
                      template. If a namespace value is hardcoded in the object, it
                      will be removed during template instantiation, however if the
                      namespace value is, or contains, a ${PARAMETER_REFERENCE}, the
                      resolved value after parameter substitution will be respected
                      and the object will be created in that namespace.
                    items:
                      type: object
                    type: array
                    x-kubernetes-preserve-unknown-fields: true
                  parameters:
                    description: parameters is an optional array of Parameters used
                      during the Template to Config transformation.
                    items:
                      description: Parameter defines a name/value variable that is
                        to be processed during the Template to Config transformation.
                      properties:
                        description:
                          description: Description of a parameter. Optional.
                          type: string
                        displayName:
                          description: 'Optional: The name that will show in UI instead
                            of parameter ''Name'''
                          type: string
                        from:
                          description: From is an input value for the generator. Optional.
                          type: string
                        generate:
                          description: "generate specifies the generator to be used
                            to generate random string from an input value specified
                            by From field. The result string is stored into Value
                            field. If empty, no generator is being used, leaving the
                            result Value untouched. Optional. \n The only supported
                            generator is \"expression\", which accepts a \"from\"
                            value in the form of a simple regular expression containing
                            the range expression \"[a-zA-Z0-9]\", and the length expression
                            \"a{length}\". \n Examples: \n from             | value
                            ----------------------------- \"test[0-9]{1}x\"  | \"test7x\"
                            \"[0-1]{8}\"       | \"01001100\" \"0x[A-F0-9]{4}\"  |
                            \"0xB3AF\" \"[a-zA-Z0-9]{8}\" | \"hW4yQU5i\""
                          type: string
                        name:
                          description: Name must be set and it can be referenced in
                            Template Items using ${PARAMETER_NAME}. Required.
                          type: string
                        required:
                          description: 'Optional: Indicates the parameter must have
                            a value.  Defaults to false.'
                          type: boolean
                        value:
                          description: Value holds the Parameter data. If specified,
                            the generator will be ignored. The value replaces all
                            occurrences of the Parameter ${Name} expression during
                            the Template to Config transformation. Optional.
                          type: string
                      required:
                      - name
                      type: object
                    type: array
                required:
                - objects
                type: object
              tierName:
                description: 'The tier of the template. For example: "basic", "advanced",
                  or "team"'
                type: string
              type:
                description: 'The type of the template. For example: "code", "dev",
                  "stage" or "cluster"'
                type: string
            required:
            - revision
            - template
            - tierName
            - type
            type: object
        type: object
        x-kubernetes-preserve-unknown-fields: true
    served: true
    storage: true
    subresources: {}
