apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: mattermostrestoredbs.mattermost.com
spec:
  group: mattermost.com
  names:
    kind: MattermostRestoreDB
    listKind: MattermostRestoreDBList
    plural: mattermostrestoredbs
    singular: mattermostrestoredb
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: State of Mattermost DB Restore
      jsonPath: .status.state
      name: State
      type: string
    - description: Original DB Replicas
      jsonPath: .status.originalDBReplicas
      name: Original DB Replicas
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: MattermostRestoreDB is the Schema for the mattermostrestoredbs
          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: MattermostRestoreDBSpec defines the desired state of MattermostRestoreDB
            properties:
              initBucketURL:
                description: InitBucketURL defines where the DB backup file is located.
                type: string
              mattermostClusterName:
                description: MattermostClusterName defines the ClusterInstallation
                  name.
                type: string
              mattermostDBName:
                description: MattermostDBName defines the database name. Need to set
                  if different from `mattermost`.
                type: string
              mattermostDBPassword:
                description: MattermostDBPassword defines the user password to access
                  the database. Need to set if the user is different from the one
                  created by the operator.
                type: string
              mattermostDBUser:
                description: MattermostDBUser defines the user to access the database.
                  Need to set if the user is different from `mmuser`.
                type: string
              restoreSecret:
                description: RestoreSecret defines the secret that holds the credentials
                  to MySQL Operator be able to download the DB backup file
                type: string
            type: object
          status:
            description: MattermostRestoreDBStatus defines the observed state of MattermostRestoreDB
            properties:
              originalDBReplicas:
                description: The original number of database replicas. will be used
                  to restore after applying the db restore process.
                format: int32
                type: integer
              state:
                description: Represents the state of the Mattermost restore Database.
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
