{
  "apiVersion": "apiextensions.k8s.io/v1",
  "kind": "CustomResourceDefinition",
  "metadata": {
    "name": "upgradeoperations.cloud.pingcap.com",
    "labels": {}
  },
  "spec": {
    "conversion": {
      "strategy": "None"
    },
    "group": "cloud.pingcap.com",
    "names": {
      "kind": "UpgradeOperation",
      "listKind": "UpgradeOperationList",
      "plural": "upgradeoperations",
      "shortNames": [
        "uo"
      ],
      "singular": "upgradeoperation"
    },
    "scope": "Namespaced",
    "versions": [
      {
        "additionalPrinterColumns": [
          {
            "jsonPath": ".spec.networkName",
            "name": "NetworkName",
            "type": "string"
          },
          {
            "jsonPath": ".spec.schedule",
            "name": "Schedule",
            "type": "string"
          },
          {
            "jsonPath": ".spec.paused",
            "name": "Paused",
            "type": "boolean"
          },
          {
            "jsonPath": ".status.phase",
            "name": "Phase",
            "type": "string"
          },
          {
            "jsonPath": ".metadata.creationTimestamp",
            "name": "AGE",
            "type": "date"
          }
        ],
        "name": "v1",
        "schema": {
          "openAPIV3Schema": {
            "description": "UpgradeOperation is the Schema for the upgradeoperations API",
            "properties": {
              "apiVersion": {
                "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore 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.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
                "type": "string"
              },
              "metadata": {
                "type": "object"
              },
              "spec": {
                "description": "UpgradeOperationSpec defines the desired state of UpgradeOperation",
                "properties": {
                  "duration": {
                    "default": "2h",
                    "description": "Duration is the desired duration of the upgrade operation, it's used for alerting.\nIf unset, this defaults to 2 hours.\nValue must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration.",
                    "type": "string"
                  },
                  "networkName": {
                    "description": "NetworkName is the name of the network CR.",
                    "type": "string"
                  },
                  "paused": {
                    "default": false,
                    "description": "Paused indicates if the upgrade operation is paused.",
                    "type": "boolean"
                  },
                  "schedule": {
                    "description": "Schedule specifies when the upgrade should be performed.\nThe UpgradeOperationScheduleLayout should be `2006-01-02 15:04:05 -0700 MST`.",
                    "type": "string"
                  },
                  "steps": {
                    "description": "Steps is a list of upgrade steps to be performed.",
                    "items": {
                      "description": "Step defines a single upgrade step, i.e. upgrade <Target> to <Version> for <Cluster>.",
                      "properties": {
                        "beginTime": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "cluster": {
                          "type": "string"
                        },
                        "duration": {
                          "type": "string"
                        },
                        "endTime": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "options": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "description": "Options is a set of key-value pairs that can be used to specify additional options.\n\nThe following options are supported:\n  - \"migrate-managed-nodegroup\": if set to \"true\", will migrate managed node groups to self-managed node groups.\n  - \"scale-out-extra-tidb\": if set to \"true\", an extra TiDB instance will be scaled out when upgrading.",
                          "type": "object"
                        },
                        "target": {
                          "type": "string"
                        },
                        "version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "target",
                        "version"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "ttl": {
                    "default": "8760h",
                    "description": "TTL is the time to live for Completed/Failed UpgradeOperation CRs.\nValue must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration.\nIf unset, this defaults to 8760 hours (1 year).",
                    "type": "string"
                  }
                },
                "required": [
                  "networkName",
                  "schedule",
                  "steps"
                ],
                "type": "object"
              },
              "status": {
                "description": "UpgradeOperationStatus defines the observed state of UpgradeOperation",
                "properties": {
                  "beginTime": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "currentStep": {
                    "description": "Step defines a single upgrade step, i.e. upgrade <Target> to <Version> for <Cluster>.",
                    "properties": {
                      "beginTime": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "cluster": {
                        "type": "string"
                      },
                      "duration": {
                        "type": "string"
                      },
                      "endTime": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "options": {
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Options is a set of key-value pairs that can be used to specify additional options.\n\nThe following options are supported:\n  - \"migrate-managed-nodegroup\": if set to \"true\", will migrate managed node groups to self-managed node groups.\n  - \"scale-out-extra-tidb\": if set to \"true\", an extra TiDB instance will be scaled out when upgrading.",
                        "type": "object"
                      },
                      "target": {
                        "type": "string"
                      },
                      "version": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "target",
                      "version"
                    ],
                    "type": "object"
                  },
                  "duration": {
                    "type": "string"
                  },
                  "endTime": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "finishedSteps": {
                    "description": "Steps is a FIFO queue of upgrade steps.",
                    "items": {
                      "description": "Step defines a single upgrade step, i.e. upgrade <Target> to <Version> for <Cluster>.",
                      "properties": {
                        "beginTime": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "cluster": {
                          "type": "string"
                        },
                        "duration": {
                          "type": "string"
                        },
                        "endTime": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "options": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "description": "Options is a set of key-value pairs that can be used to specify additional options.\n\nThe following options are supported:\n  - \"migrate-managed-nodegroup\": if set to \"true\", will migrate managed node groups to self-managed node groups.\n  - \"scale-out-extra-tidb\": if set to \"true\", an extra TiDB instance will be scaled out when upgrading.",
                          "type": "object"
                        },
                        "target": {
                          "type": "string"
                        },
                        "version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "target",
                        "version"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "nextSteps": {
                    "description": "Steps is a FIFO queue of upgrade steps.",
                    "items": {
                      "description": "Step defines a single upgrade step, i.e. upgrade <Target> to <Version> for <Cluster>.",
                      "properties": {
                        "beginTime": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "cluster": {
                          "type": "string"
                        },
                        "duration": {
                          "type": "string"
                        },
                        "endTime": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "options": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "description": "Options is a set of key-value pairs that can be used to specify additional options.\n\nThe following options are supported:\n  - \"migrate-managed-nodegroup\": if set to \"true\", will migrate managed node groups to self-managed node groups.\n  - \"scale-out-extra-tidb\": if set to \"true\", an extra TiDB instance will be scaled out when upgrading.",
                          "type": "object"
                        },
                        "target": {
                          "type": "string"
                        },
                        "version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "target",
                        "version"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "phase": {
                    "description": "Phase describes the current phase of the upgrade operation.",
                    "type": "string"
                  },
                  "reason": {
                    "description": "Reason describes the reason for the current phase.",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          }
        },
        "served": true,
        "storage": true,
        "subresources": {
          "status": {}
        }
      }
    ]
  }
}
