apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: migrations.openmcp.k8s.io
  annotations:
    "api-approved.kubernetes.io": "https://github.com/kubernetes/kubernetes/pull/78458"
spec:
  group: openmcp.k8s.io
  names:
    kind: Migration
    listKind: MigrationList
    plural: migrations
    singular: migration
  scope: Namespaced
  versions:
  - name: v1alpha1
    additionalPrinterColumns:
    - description: Created time stamp
      jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    - description: '-'
      jsonPath: .spec.migrationServiceSource[*].sourceCluster
      name: SourceCluster
      type: string
    - description: '-'
      jsonPath: .spec.migrationServiceSource[*].targetCluster
      name: TargetCluster
      type: string
    - description: '-'
      jsonPath: .spec.migrationServiceSource[*].serviceName
      name: ServiceName
      type: string
    - description: '-'
      jsonPath: .spec.migrationServiceSource[*].nameSpace
      name: NameSpace
      type: string
    - 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
    - description: '-'
      jsonPath: .status.isZeroDownTime
      name: IsZeroDownTime
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: Migration is the Schema for the Migrations 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: MigrationSpec defines the desired state of Migration
            properties:
              migrationServiceSource:
                description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
                  Important: Run "make" to regenerate code after modifying this file'
                items:
                  properties:
                    migrationSource:
                      description: container service spec
                      items:
                        properties:
                          resourceName:
                            type: string
                          resourceType:
                            description: Migration source
                            type: string
                        required:
                        - resourceName
                        - resourceType
                        type: object
                      type: array
                    nameSpace:
                      type: string
                    serviceName:
                      type: string
                    sourceCluster:
                      type: string
                    targetCluster:
                      type: string
                  required:
                  - migrationSource
                  - nameSpace
                  - serviceName
                  - sourceCluster
                  - targetCluster
                  type: object
                type: array
            required:
            - migrationServiceSource
            type: object
          status:
            description: MigrationStatus defines the observed state of Migration
            properties:
              currentCount:
                description: 현재 진행도
                format: int32
                type: integer
              description:
                type: string
              elapsedTime:
                type: string
              isZeroDownTime:
                description: Status of the condition, one of True, False, Unknown.
                type: string
              maxCount:
                description: 최대 진행도
                format: int32
                type: integer
              progress:
                description: 최대 컨디션 카운트. currentCount/maxCount
                type: string
              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: {}
