apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: nstemplatetiers.toolchain.dev.openshift.com
spec:
  group: toolchain.dev.openshift.com
  names:
    kind: NSTemplateTier
    listKind: NSTemplateTierList
    plural: nstemplatetiers
    shortNames:
    - tier
    singular: nstemplatetier
  scope: Namespaced
  versions:
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        description: NSTemplateTier configures user environment via templates used
          for namespaces the user has access to
        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: NSTemplateTierSpec defines the desired state of NSTemplateTier
            properties:
              clusterResources:
                description: the cluster resources template (for cluster-wide quotas,
                  etc.)
                properties:
                  templateRef:
                    description: TemplateRef The name of the TierTemplate resource
                      which exists in the host cluster and which contains the template
                      to use
                    type: string
                required:
                - templateRef
                type: object
              deactivationTimeoutDays:
                description: the period (in days) after which users within the tier
                  will be deactivated
                type: integer
              namespaces:
                description: The namespace templates
                items:
                  description: NSTemplateTierNamespace the namespace definition in
                    an NSTemplateTier resource
                  properties:
                    templateRef:
                      description: TemplateRef The name of the TierTemplate resource
                        which exists in the host cluster and which contains the template
                        to use
                      type: string
                  required:
                  - templateRef
                  type: object
                type: array
                x-kubernetes-list-type: atomic
            required:
            - namespaces
            type: object
          status:
            description: NSTemplateTierStatus defines the observed state of NSTemplateTier
            properties:
              conditions:
                description: 'Conditions is an array of current NSTemplateTier conditions
                  Supported condition types: ConditionReady NSTemplateTierSuccessfulUpdatesCount
                  NSTemplateTierFailedUpdatesCount'
                items:
                  properties:
                    lastTransitionTime:
                      description: Last time the condition transit from one status
                        to another.
                      format: date-time
                      type: string
                    lastUpdatedTime:
                      description: Last time the condition was updated
                      format: date-time
                      type: string
                    message:
                      description: Human readable message indicating details about
                        last transition.
                      type: string
                    reason:
                      description: (brief) reason for the condition's last transition.
                      type: string
                    status:
                      description: Status of the condition, one of True, False, Unknown.
                      type: string
                    type:
                      description: Type of condition
                      type: string
                  required:
                  - status
                  - type
                  type: object
                type: array
                x-kubernetes-list-map-keys:
                - type
                x-kubernetes-list-type: map
              updates:
                description: Updates is an array of all NSTemplateTier updates
                items:
                  description: NSTemplateTierHistory a track record of an update
                  properties:
                    completionTime:
                      description: CompletionTime is the time when the last MasterUserRecord
                        was updated
                      format: date-time
                      type: string
                    failedAccounts:
                      description: FailedAccounts
                      items:
                        type: string
                      type: array
                    failures:
                      description: Failures is the number of MasterUserRecords which
                        failed to be updated
                      type: integer
                    hash:
                      description: Hash the hash matching on the templateRefs in the
                        resource spec
                      type: string
                    startTime:
                      description: StartTime is the time when the NSTemplateTier was
                        updated
                      format: date-time
                      type: string
                  required:
                  - failures
                  - hash
                  - startTime
                  type: object
                type: array
                x-kubernetes-list-map-keys:
                - startTime
                x-kubernetes-list-type: map
            type: object
        type: object
        x-kubernetes-preserve-unknown-fields: true
    served: true
    storage: true
    subresources:
      status: {}
