apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.20.0
  name: pointintimerecoveries.k8s.mariadb.com
spec:
  group: k8s.mariadb.com
  names:
    kind: PointInTimeRecovery
    listKind: PointInTimeRecoveryList
    plural: pointintimerecoveries
    shortNames:
      - pitr
    singular: pointintimerecovery
  scope: Namespaced
  versions:
    - additionalPrinterColumns:
        - jsonPath: .spec.physicalBackupRef.name
          name: Physical Backup
          type: string
        - jsonPath: .status.lastRecoverableTime
          name: Last Recoverable Time
          type: string
        - jsonPath: .spec.strictMode
          name: Strict Mode
          type: boolean
        - jsonPath: .metadata.creationTimestamp
          name: Age
          type: date
      name: v1alpha1
      schema:
        openAPIV3Schema:
          description: PointInTimeRecovery is the Schema for the pointintimerecoveries API. It contains binlog archival and point-in-time restoration settings.
          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: PointInTimeRecoverySpec defines the desired state of PointInTimeRecovery. It contains binlog archive and point-in-time restoration settings.
              properties:
                archiveTimeout:
                  default: 1h
                  description: |-
                    ArchiveTimeout defines the maximum duration for the binary log archival.
                    If this duration is exceeded, the sidecar agent will log an error and it will be retried in the next archive cycle.
                    It defaults to 1 hour.
                  type: string
                compression:
                  description: |-
                    Compression algorithm to be used for compressing the binary logs.
                    This field is immutable, it cannot be updated after creation.
                  enum:
                    - none
                    - bzip2
                    - gzip
                  type: string
                physicalBackupRef:
                  description: PhysicalBackupRef is a reference to a PhysicalBackup object that will be used as base backup.
                  properties:
                    name:
                      default: ""
                      type: string
                  type: object
                storage:
                  description: PointInTimeRecoveryStorage is the storage where the point in time recovery data will be stored
                  properties:
                    azureBlob:
                      description: AzureBlob is the Azure Blob Storage where the binary logs will be kept.
                      properties:
                        containerName:
                          description: ContainerName is the name of the storage container.
                          type: string
                        prefix:
                          description: 'Prefix indicates a folder/subfolder in the container. For example: mariadb/ or mariadb/backups. A trailing slash ''/'' is added if not provided.'
                          type: string
                        serviceURL:
                          description: 'ServiceURL is the full URL for connecting to Azure, usually in the form: http(s)://<account>.blob.core.windows.net/.'
                          type: string
                        storageAccountKey:
                          description: StorageAccountKey is a reference to a Secret key containing the Azure Blob Storage Storage account Key. Pairs with StorageAccountKey for static credential authentication
                          properties:
                            key:
                              type: string
                            name:
                              default: ""
                              type: string
                          required:
                            - key
                          type: object
                          x-kubernetes-map-type: atomic
                        storageAccountName:
                          description: StorageAccountName is the name of the storage account. Pairs with StorageAccountKey for static credential authentication
                          type: string
                        tls:
                          description: TLS provides the configuration required to establish TLS connections with Azure Blob Storage.
                          properties:
                            caSecretKeyRef:
                              description: |-
                                CASecretKeyRef is a reference to a Secret key containing a CA bundle in PEM format used to establish TLS connections with S3.
                                By default, the system trust chain will be used, but you can use this field to add more CAs to the bundle.
                              properties:
                                key:
                                  type: string
                                name:
                                  default: ""
                                  type: string
                              required:
                                - key
                              type: object
                              x-kubernetes-map-type: atomic
                            enabled:
                              description: Enabled is a flag to enable TLS.
                              type: boolean
                          type: object
                      required:
                        - containerName
                        - serviceURL
                      type: object
                    s3:
                      description: S3 is the S3-compatible storage where the binary logs will be kept.
                      properties:
                        accessKeyIdSecretKeyRef:
                          description: AccessKeyIdSecretKeyRef is a reference to a Secret key containing the S3 access key id.
                          properties:
                            key:
                              type: string
                            name:
                              default: ""
                              type: string
                          required:
                            - key
                          type: object
                          x-kubernetes-map-type: atomic
                        bucket:
                          description: Bucket is the name Name of the bucket to store backups.
                          type: string
                        endpoint:
                          description: Endpoint is the S3 API endpoint without scheme.
                          type: string
                        prefix:
                          description: 'Prefix indicates a folder/subfolder in the bucket. For example: mariadb/ or mariadb/backups. A trailing slash ''/'' is added if not provided.'
                          type: string
                        region:
                          description: Region is the S3 region name to use.
                          type: string
                        secretAccessKeySecretKeyRef:
                          description: AccessKeyIdSecretKeyRef is a reference to a Secret key containing the S3 secret key.
                          properties:
                            key:
                              type: string
                            name:
                              default: ""
                              type: string
                          required:
                            - key
                          type: object
                          x-kubernetes-map-type: atomic
                        sessionTokenSecretKeyRef:
                          description: SessionTokenSecretKeyRef is a reference to a Secret key containing the S3 session token.
                          properties:
                            key:
                              type: string
                            name:
                              default: ""
                              type: string
                          required:
                            - key
                          type: object
                          x-kubernetes-map-type: atomic
                        ssec:
                          description: |-
                            SSEC is a reference to a Secret containing the SSE-C (Server-Side Encryption with Customer-Provided Keys) key.
                            The secret must contain a 32-byte key (256 bits) in the specified key.
                            This enables server-side encryption where you provide and manage the encryption key.
                          properties:
                            customerKeySecretKeyRef:
                              description: |-
                                CustomerKeySecretKeyRef is a reference to a Secret key containing the SSE-C customer-provided encryption key.
                                The key must be a 32-byte (256-bit) key encoded in base64.
                              properties:
                                key:
                                  type: string
                                name:
                                  default: ""
                                  type: string
                              required:
                                - key
                              type: object
                              x-kubernetes-map-type: atomic
                          required:
                            - customerKeySecretKeyRef
                          type: object
                        tls:
                          description: TLS provides the configuration required to establish TLS connections with S3.
                          properties:
                            caSecretKeyRef:
                              description: |-
                                CASecretKeyRef is a reference to a Secret key containing a CA bundle in PEM format used to establish TLS connections with S3.
                                By default, the system trust chain will be used, but you can use this field to add more CAs to the bundle.
                              properties:
                                key:
                                  type: string
                                name:
                                  default: ""
                                  type: string
                              required:
                                - key
                              type: object
                              x-kubernetes-map-type: atomic
                            enabled:
                              description: Enabled is a flag to enable TLS.
                              type: boolean
                          type: object
                      required:
                        - bucket
                        - endpoint
                      type: object
                  type: object
                strictMode:
                  description: |-
                    StrictMode controls the behavior when a point-in-time restoration cannot reach the exact target time:
                    When enabled: Returns an error and avoids replaying binary logs if target time is not reached.
                    When disabled (default): Replays available binary logs until the last recoverable time. It logs logs an error if target time is not reached.
                  type: boolean
              required:
                - physicalBackupRef
                - storage
              type: object
            status:
              description: PointInTimeRecoveryStatus represents the current status of the point-in-time-recovery.
              properties:
                lastRecoverableTime:
                  description: LastRecoverableTime is the most recent recoverable time based on the current state of physical backups and archived binary logs.
                  type: string
              type: object
          type: object
      served: true
      storage: true
      subresources:
        status: {}
