---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.17.3
  name: clusterupgradeoperations.observability.pingcap.com
spec:
  group: observability.pingcap.com
  names:
    kind: ClusterUpgradeOperation
    listKind: ClusterUpgradeOperationList
    plural: clusterupgradeoperations
    singular: clusterupgradeoperation
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .status.phase
      name: PHASE
      type: string
    - jsonPath: .spec.k8sClusterName
      name: CLUSTER
      type: string
    - jsonPath: .spec.cloudProvider
      name: PROVIDER
      type: string
    - jsonPath: .status.currentStep.processor
      name: CURRENT_STEP
      type: string
    - jsonPath: .status.currentStep.subStep
      name: SUB_STEP
      type: string
    - jsonPath: .spec.targetVersion
      name: TARGET_VERSION
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: AGE
      type: date
    name: v1
    schema:
      openAPIV3Schema:
        description: ClusterUpgradeOperation is the Schema for the clusterupgradeoperations
          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: ClusterUpgradeOperationSpec defines the desired state of
              ClusterUpgradeOperation
            properties:
              cloudProvider:
                description: CloudProvider is the cloud provider of the cluster
                enum:
                - eks
                - gke
                - aks
                - ack
                type: string
              k8sClusterName:
                description: K8sClusterName is the name of the target Kubernetes cluster
                type: string
              paused:
                description: Paused indicates whether the operation is paused
                type: boolean
              region:
                description: Region is the cloud region where the cluster is located
                type: string
              schedule:
                description: Schedule is the scheduled time to start the operation
                format: date-time
                type: string
              steps:
                description: Steps is the ordered list of upgrade steps to execute
                items:
                  description: UpgradeStep defines an atomic upgrade step
                  properties:
                    beginTime:
                      description: BeginTime is the time when this step started
                      format: date-time
                      type: string
                    cloudOperationID:
                      description: |-
                        CloudOperationID stores the cloud provider's async operation ID (e.g. GKE Operation name) for polling.
                        Used when UpgradeNodeGroup returns an operation ID; we poll this to determine completion.
                      type: string
                    duration:
                      description: Duration is the human-readable duration of this
                        step
                      type: string
                    endTime:
                      description: EndTime is the time when this step completed
                      format: date-time
                      type: string
                    options:
                      description: Options contains processor-specific parameters
                      type: object
                      x-kubernetes-preserve-unknown-fields: true
                    processor:
                      description: Processor is the name of the processor to execute
                      enum:
                      - upgrade-controlplane
                      - upgrade-cluster-addons
                      - upgrade-node-group
                      type: string
                    subStep:
                      description: 'SubStep is the current sub-step within this step
                        (e.g. for blue-green node group: create-nodegroup, wait-ready,
                        cordon, vmstorage-rollout, delete-old-nodegroup).'
                      type: string
                    subStepBeginTime:
                      description: SubStepBeginTime is when the current sub-step started.
                      format: date-time
                      type: string
                  required:
                  - processor
                  type: object
                type: array
              targetVersion:
                description: TargetVersion is the target Kubernetes version to upgrade
                  to
                type: string
              ttlSeconds:
                description: TTLSeconds is the time-to-live after completion before
                  auto-deletion
                type: string
            required:
            - cloudProvider
            - k8sClusterName
            - paused
            - region
            - schedule
            - steps
            - targetVersion
            type: object
          status:
            description: ClusterUpgradeOperationStatus defines the observed state
              of ClusterUpgradeOperation
            properties:
              beginTime:
                description: BeginTime is the time when the operation started
                format: date-time
                type: string
              currentStep:
                description: CurrentStep is the step currently being executed
                properties:
                  beginTime:
                    description: BeginTime is the time when this step started
                    format: date-time
                    type: string
                  cloudOperationID:
                    description: |-
                      CloudOperationID stores the cloud provider's async operation ID (e.g. GKE Operation name) for polling.
                      Used when UpgradeNodeGroup returns an operation ID; we poll this to determine completion.
                    type: string
                  duration:
                    description: Duration is the human-readable duration of this step
                    type: string
                  endTime:
                    description: EndTime is the time when this step completed
                    format: date-time
                    type: string
                  options:
                    description: Options contains processor-specific parameters
                    type: object
                    x-kubernetes-preserve-unknown-fields: true
                  processor:
                    description: Processor is the name of the processor to execute
                    enum:
                    - upgrade-controlplane
                    - upgrade-cluster-addons
                    - upgrade-node-group
                    type: string
                  subStep:
                    description: 'SubStep is the current sub-step within this step
                      (e.g. for blue-green node group: create-nodegroup, wait-ready,
                      cordon, vmstorage-rollout, delete-old-nodegroup).'
                    type: string
                  subStepBeginTime:
                    description: SubStepBeginTime is when the current sub-step started.
                    format: date-time
                    type: string
                required:
                - processor
                type: object
              duration:
                description: Duration is the human-readable duration of the operation
                type: string
              endTime:
                description: EndTime is the time when the operation completed
                format: date-time
                type: string
              nextSteps:
                description: NextSteps is the queue of steps to be executed
                items:
                  description: UpgradeStep defines an atomic upgrade step
                  properties:
                    beginTime:
                      description: BeginTime is the time when this step started
                      format: date-time
                      type: string
                    cloudOperationID:
                      description: |-
                        CloudOperationID stores the cloud provider's async operation ID (e.g. GKE Operation name) for polling.
                        Used when UpgradeNodeGroup returns an operation ID; we poll this to determine completion.
                      type: string
                    duration:
                      description: Duration is the human-readable duration of this
                        step
                      type: string
                    endTime:
                      description: EndTime is the time when this step completed
                      format: date-time
                      type: string
                    options:
                      description: Options contains processor-specific parameters
                      type: object
                      x-kubernetes-preserve-unknown-fields: true
                    processor:
                      description: Processor is the name of the processor to execute
                      enum:
                      - upgrade-controlplane
                      - upgrade-cluster-addons
                      - upgrade-node-group
                      type: string
                    subStep:
                      description: 'SubStep is the current sub-step within this step
                        (e.g. for blue-green node group: create-nodegroup, wait-ready,
                        cordon, vmstorage-rollout, delete-old-nodegroup).'
                      type: string
                    subStepBeginTime:
                      description: SubStepBeginTime is when the current sub-step started.
                      format: date-time
                      type: string
                  required:
                  - processor
                  type: object
                type: array
              phase:
                description: Phase describes the current phase of the upgrade operation
                type: string
              succeededSteps:
                description: SucceededSteps is the list of steps that have completed
                  successfully
                items:
                  description: UpgradeStep defines an atomic upgrade step
                  properties:
                    beginTime:
                      description: BeginTime is the time when this step started
                      format: date-time
                      type: string
                    cloudOperationID:
                      description: |-
                        CloudOperationID stores the cloud provider's async operation ID (e.g. GKE Operation name) for polling.
                        Used when UpgradeNodeGroup returns an operation ID; we poll this to determine completion.
                      type: string
                    duration:
                      description: Duration is the human-readable duration of this
                        step
                      type: string
                    endTime:
                      description: EndTime is the time when this step completed
                      format: date-time
                      type: string
                    options:
                      description: Options contains processor-specific parameters
                      type: object
                      x-kubernetes-preserve-unknown-fields: true
                    processor:
                      description: Processor is the name of the processor to execute
                      enum:
                      - upgrade-controlplane
                      - upgrade-cluster-addons
                      - upgrade-node-group
                      type: string
                    subStep:
                      description: 'SubStep is the current sub-step within this step
                        (e.g. for blue-green node group: create-nodegroup, wait-ready,
                        cordon, vmstorage-rollout, delete-old-nodegroup).'
                      type: string
                    subStepBeginTime:
                      description: SubStepBeginTime is when the current sub-step started.
                      format: date-time
                      type: string
                  required:
                  - processor
                  type: object
                type: array
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
