apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: snapshotrestores.openmcp.k8s.io
spec:
  group: openmcp.k8s.io
  names:
    kind: SnapshotRestore
    listKind: SnapshotRestoreList
    plural: snapshotrestores
    singular: snapshotrestore
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: Created time stamp
      jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    - description: '-'
      jsonPath: .spec.snapshotRestoreSources[*].resourceCluster
      name: Cluster
      type: string
    - description: '-'
      jsonPath: .spec.snapshotRestoreSources[*].resourceNamespace
      name: NameSpace
      type: string
    - description: '-'
      jsonPath: .spec.groupSnapshotKey
      name: SnapshotKey
      type: string
    - description: '-'
      jsonPath: .spec.isGroupSnapshot
      name: IsGroupSnapshot
      type: boolean
    - description: '-'
      jsonPath: .status.status
      name: Status
      type: string
    - description: '-'
      jsonPath: .status.description
      name: Description
      type: string
    - description: '-'
      jsonPath: .status.progress
      name: Progress
      type: string
    - description: ElapsedTime
      jsonPath: .status.elapsedTime
      name: ElapsedTime
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: SnapshotRestore is the Schema for the openmcpsnapshotrestores
          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: SnapshotRestoreSpec defines the desired state of SnapshotRestore
            properties:
              groupSnapshotKey:
                type: string
              isGroupSnapshot:
                type: boolean
              snapshotRestoreSource:
                description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
                  Important: Run "operator-sdk generate k8s" to regenerate code after
                  modifying this file Add custom validation using kubebuilder tags:
                  https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
                items:
                  description: SnapshotRestoreSource contains the supported SnapshotRestore
                    sources.
                  properties:
                    resourceCluster:
                      type: string
                    resourceNamespace:
                      type: string
                    resourceSnapshotKey:
                      type: string
                    resourceType:
                      type: string
                    volumeSnapshotKey:
                      type: string
                  required:
                  - resourceCluster
                  - resourceNamespace
                  - resourceSnapshotKey
                  - resourceType
                  type: object
                type: array
            required:
            - groupSnapshotKey
            type: object
          status:
            description: SnapshotRestoreStatus defines the observed state of SnapshotRestore
            properties:
              ElapsedTime:
                description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
                  of cluster Important: Run "operator-sdk generate k8s" to regenerate
                  code after modifying this file Add custom validation using kubebuilder
                  tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
                  Succeeded indicates if the backup has Succeeded. LastSuccessDate
                  indicate the time to get snapshot last time LastSuccessDate metav1.Time
                  `json:"lastSuccessDate,omitempty"`'
                type: string
              currentCount:
                description: 현재 진행도
                format: int32
                type: integer
              description:
                type: string
              isVolumeSnapshot:
                description: isVolumeSnapshot
                type: boolean
              maxCount:
                description: 최대 진행도
                format: int32
                type: integer
              progress:
                description: 최대 컨디션 카운트. currentCount/maxCount
                type: string
              snapshotRestoreSource:
                items:
                  description: SnapshotRestoreSource contains the supported SnapshotRestore
                    sources.
                  properties:
                    resourceCluster:
                      type: string
                    resourceNamespace:
                      type: string
                    resourceSnapshotKey:
                      type: string
                    resourceType:
                      type: string
                    volumeSnapshotKey:
                      type: string
                  required:
                  - resourceCluster
                  - resourceNamespace
                  - resourceSnapshotKey
                  - resourceType
                  type: object
                type: array
              status:
                description: Condition 정보 리스트 Conditions []MigrationCondition `json:"conditions,omitempty"`
                  Status of the condition, one of True, False, Unknown.
                type: string
            required:
            - description
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
