---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.16.3
  name: compactbackups.cloud.pingcap.com
spec:
  group: cloud.pingcap.com
  names:
    kind: CompactBackup
    listKind: CompactBackupList
    plural: compactbackups
    shortNames:
    - cpbk
    singular: compactbackup
  preserveUnknownFields: false
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: CompactBackup is the Schema for the compactbackups 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: CompactBackupSpec defines the desired state of CompactBackup
            properties:
              cleanPolicy:
                default: Retain
                description: CleanPolicy denotes whether to clean compact data when
                  deleted
                type: string
              clusterName:
                description: ClusterName is the name of the TiDB cluster to compact
                type: string
              concurrency:
                default: 4
                description: Concurrency is the concurrency for compact
                format: int32
                type: integer
              configuration:
                description: Configuration contains compact-specific configurations
                properties:
                  baseImage:
                    description: BaseImage of the component
                    type: string
                  config:
                    description: Config is the default configuration of component
                    type: string
                  tag:
                    description: Tag is component image tag
                    type: string
                  tikvImage:
                    description: TiKVImage is the custom TiKV image
                    type: string
                  tikvVersion:
                    description: TiKVVersion is the custom TiKV version
                    type: string
                type: object
              endTs:
                description: EndTs is the end timestamp for compact
                type: string
              instanceType:
                description: InstanceType specifies the instance type for compact
                type: string
              resourceRequirements:
                description: ResourceRequirements manage resources(cpu,memory) of
                  compact pod
                properties:
                  claims:
                    description: |-
                      Claims lists the names of resources, defined in spec.resourceClaims,
                      that are used by this container.

                      This is an alpha field and requires enabling the
                      DynamicResourceAllocation feature gate.

                      This field is immutable. It can only be set for containers.
                    items:
                      description: ResourceClaim references one entry in PodSpec.ResourceClaims.
                      properties:
                        name:
                          description: |-
                            Name must match the name of one entry in pod.spec.resourceClaims of
                            the Pod where this field is used. It makes that resource available
                            inside a container.
                          type: string
                        request:
                          description: |-
                            Request is the name chosen for a request in the referenced claim.
                            If empty, everything from the claim is made available, otherwise
                            only the result of this request.
                          type: string
                      required:
                      - name
                      type: object
                    type: array
                    x-kubernetes-list-map-keys:
                    - name
                    x-kubernetes-list-type: map
                  limits:
                    additionalProperties:
                      anyOf:
                      - type: integer
                      - type: string
                      pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                      x-kubernetes-int-or-string: true
                    description: |-
                      Limits describes the maximum amount of compute resources allowed.
                      More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
                    type: object
                  requests:
                    additionalProperties:
                      anyOf:
                      - type: integer
                      - type: string
                      pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                      x-kubernetes-int-or-string: true
                    description: |-
                      Requests describes the minimum amount of compute resources required.
                      If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
                      otherwise to an implementation-defined value. Requests cannot exceed Limits.
                      More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
                    type: object
                type: object
              startTs:
                description: StartTs is the start timestamp for compact
                type: string
              storage:
                description: Storage is the storage URL for compact backup
                type: string
            required:
            - clusterName
            type: object
          status:
            description: CompactBackupStatus defines the observed state of CompactBackup
            properties:
              backupPath:
                description: BackupPath is the location of the compact backup.
                type: string
              completionTime:
                description: CompletionTime is when compact completed
                format: date-time
                type: string
              endTs:
                description: EndTs is the real endTs processed by compact
                type: string
              message:
                description: Message is the error message
                type: string
              phase:
                description: Phase represents the current phase of compact backup
                type: string
              progress:
                description: Progress is the detailed progress of compact
                type: string
              startTime:
                description: StartTime is when compact started
                format: date-time
                type: string
              state:
                description: State is the current state of the compact
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
