---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: pulprestores.pulp.pulpproject.org
spec:
  group: pulp.pulpproject.org
  names:
    kind: PulpRestore
    listKind: PulpRestoreList
    plural: pulprestores
    singular: pulprestore
  scope: Namespaced
  versions:
    - name: v1beta1
      served: true
      storage: true
      subresources:
        status: {}
      schema:
        openAPIV3Schema:
          type: object
          x-kubernetes-preserve-unknown-fields: true
          description: Schema validation for the PulpRestore CRD
          properties:
            spec:
              type: object
              properties:
                backup_source:
                  description: backup source
                  type: string
                  enum:
                    - CR
                    - PVC
                custom_resource_key:
                  description: custom_resource_key
                  type: string
                deployment_name:
                  description: Name of the deployment to be restored to
                  type: string
                backup_name:
                  description: Name of the backup custom resource
                  type: string
                backup_pvc:
                  description: Name of the PVC to be restored from, set as a status found on the backup object (backupClaim)
                  type: string
                backup_pvc_namespace:
                  description: Namespace the PVC is in
                  type: string
                backup_dir:
                  description: Backup directory name, set as a status found on the backup object (backupDirectory)
                  type: string
                storage_type:
                  description: Configuration for the storage type utilized in the backup
                  type: string
                postgres_label_selector:
                  description: Label selector used to identify postgres pod for executing migration
                  type: string
              oneOf:
                - required: ["backup_name", "backup_pvc"]
            status:
              properties:
                restoreComplete:
                  description: The state of the restore
                  type: boolean
                conditions:
                  description: The resulting conditions when a Service Telemetry is instantiated
                  items:
                    properties:
                      status:
                        type: string
                      type:
                        type: string
                      reason:
                        type: string
                      lastTransitionTime:
                        type: string
                    type: object
                  type: array
              type: object
