apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: toolchainconfigs.toolchain.dev.openshift.com
spec:
  group: toolchain.dev.openshift.com
  names:
    kind: ToolchainConfig
    listKind: ToolchainConfigList
    plural: toolchainconfigs
    singular: toolchainconfig
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.host.automaticApproval.enabled
      name: AutomaticApproval
      type: boolean
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: ToolchainConfig keeps all configuration parameters needed for
          host and member operators
        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: ToolchainConfigSpec contains all configuration for host and
              member operators
            properties:
              host:
                description: Contains all host operator configuration
                properties:
                  automaticApproval:
                    description: Keeps parameters necessary for automatic approval
                    properties:
                      enabled:
                        description: Defines if the automatic approval is enabled
                          or not
                        type: boolean
                      maxNumberOfUsers:
                        description: Defines the maximal number of users to be allowed
                          for automatic approval. When the number is reached, then
                          the automatic approval is stopped.
                        properties:
                          overall:
                            description: It is the maximal number of users provisioned
                              in the system overall - equals to max number of MasterUserRecords
                              in host cluster
                            type: integer
                          specificPerMemberCluster:
                            additionalProperties:
                              type: integer
                            description: Contains a map of maximal number of users
                              provisioned per member cluster mapped by the cluster
                              name - equals to max number of UserAccounts in member
                              cluster
                            type: object
                            x-kubernetes-map-type: atomic
                        type: object
                      resourceCapacityThreshold:
                        description: Contains threshold (in percentage of usage) that
                          defines when the automatic approval should be stopped
                        properties:
                          defaultThreshold:
                            description: It is the default capacity threshold (in
                              percentage of usage) to be used for all member clusters
                              if no special threshold is defined
                            type: integer
                          specificPerMemberCluster:
                            additionalProperties:
                              type: integer
                            description: Contains a map of specific capacity thresholds
                              (in percentage of usage) for particular member clusters
                              mapped by their names
                            type: object
                            x-kubernetes-map-type: atomic
                        type: object
                    type: object
                  deactivation:
                    description: Keeps parameters concerned with user deactivation
                    properties:
                      deactivatingNotificationDays:
                        description: DeactivatingNotificationDays is the number of
                          days after a pre-deactivating notification is sent that
                          actual deactivation occurs.  If this parameter is set to
                          zero, then there will be no delay
                        type: integer
                    type: object
                type: object
              members:
                description: Contains all member operator configurations for all member
                  clusters
                properties:
                  default:
                    description: Defines default configuration to be applied to all
                      member clusters
                    properties:
                      memberStatus:
                        description: Keeps parameters concerned with member status
                        properties:
                          refreshPeriod:
                            description: Defines the period between refreshes of the
                              member status
                            type: string
                        type: object
                    type: object
                  specificPerMemberCluster:
                    additionalProperties:
                      description: MemberOperatorConfigSpec contains all configuration
                        parameters of the member operator
                      properties:
                        memberStatus:
                          description: Keeps parameters concerned with member status
                          properties:
                            refreshPeriod:
                              description: Defines the period between refreshes of
                                the member status
                              type: string
                          type: object
                      type: object
                    description: A map of cluster-specific member operator configurations
                      indexed by member toolchaincluster name
                    type: object
                    x-kubernetes-map-type: atomic
                type: object
            type: object
          status:
            description: ToolchainConfigStatus defines the observed state of ToolchainConfig
            type: object
        type: object
        x-kubernetes-preserve-unknown-fields: true
    served: true
    storage: true
    subresources:
      status: {}
