---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.17.3
  name: vmoperations.observability.pingcap.com
spec:
  group: observability.pingcap.com
  names:
    kind: VMOperation
    listKind: VMOperationList
    plural: vmoperations
    singular: vmoperation
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .status.phase
      name: PHASE
      type: string
    - jsonPath: .spec.targetRef.podName
      name: TARGET
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: AGE
      type: date
    name: v1
    schema:
      openAPIV3Schema:
        description: VMOperation is the Schema for the vmoperations 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: VMOperationSpec defines the desired state of VMOperation
            properties:
              paused:
                type: boolean
              schedule:
                format: date-time
                type: string
              steps:
                items:
                  properties:
                    beginTime:
                      format: date-time
                      type: string
                    duration:
                      type: string
                    endTime:
                      format: date-time
                      type: string
                    options:
                      additionalProperties:
                        type: string
                      type: object
                    processor:
                      type: string
                  required:
                  - processor
                  type: object
                type: array
              targetRef:
                properties:
                  clusterName:
                    type: string
                  namespace:
                    type: string
                  podName:
                    type: string
                required:
                - clusterName
                - namespace
                - podName
                type: object
              ttlSeconds:
                type: string
            required:
            - paused
            - schedule
            - steps
            - targetRef
            type: object
          status:
            description: VMOperationStatus defines the observed state of VMOperation
            properties:
              SucceededSteps:
                items:
                  properties:
                    beginTime:
                      format: date-time
                      type: string
                    duration:
                      type: string
                    endTime:
                      format: date-time
                      type: string
                    options:
                      additionalProperties:
                        type: string
                      type: object
                    processor:
                      type: string
                  required:
                  - processor
                  type: object
                type: array
              beginTime:
                format: date-time
                type: string
              copyPVCSpec:
                description: |-
                  PersistentVolumeClaimSpec describes the common attributes of storage devices
                  and allows a Source for provider-specific attributes
                properties:
                  accessModes:
                    description: |-
                      accessModes contains the desired access modes the volume should have.
                      More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
                    items:
                      type: string
                    type: array
                    x-kubernetes-list-type: atomic
                  dataSource:
                    description: |-
                      dataSource field can be used to specify either:
                      * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)
                      * An existing PVC (PersistentVolumeClaim)
                      If the provisioner or an external controller can support the specified data source,
                      it will create a new volume based on the contents of the specified data source.
                      When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef,
                      and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified.
                      If the namespace is specified, then dataSourceRef will not be copied to dataSource.
                    properties:
                      apiGroup:
                        description: |-
                          APIGroup is the group for the resource being referenced.
                          If APIGroup is not specified, the specified Kind must be in the core API group.
                          For any other third-party types, APIGroup is required.
                        type: string
                      kind:
                        description: Kind is the type of resource being referenced
                        type: string
                      name:
                        description: Name is the name of resource being referenced
                        type: string
                    required:
                    - kind
                    - name
                    type: object
                    x-kubernetes-map-type: atomic
                  dataSourceRef:
                    description: |-
                      dataSourceRef specifies the object from which to populate the volume with data, if a non-empty
                      volume is desired. This may be any object from a non-empty API group (non
                      core object) or a PersistentVolumeClaim object.
                      When this field is specified, volume binding will only succeed if the type of
                      the specified object matches some installed volume populator or dynamic
                      provisioner.
                      This field will replace the functionality of the dataSource field and as such
                      if both fields are non-empty, they must have the same value. For backwards
                      compatibility, when namespace isn't specified in dataSourceRef,
                      both fields (dataSource and dataSourceRef) will be set to the same
                      value automatically if one of them is empty and the other is non-empty.
                      When namespace is specified in dataSourceRef,
                      dataSource isn't set to the same value and must be empty.
                      There are three important differences between dataSource and dataSourceRef:
                      * While dataSource only allows two specific types of objects, dataSourceRef
                        allows any non-core object, as well as PersistentVolumeClaim objects.
                      * While dataSource ignores disallowed values (dropping them), dataSourceRef
                        preserves all values, and generates an error if a disallowed value is
                        specified.
                      * While dataSource only allows local objects, dataSourceRef allows objects
                        in any namespaces.
                      (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
                      (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
                    properties:
                      apiGroup:
                        description: |-
                          APIGroup is the group for the resource being referenced.
                          If APIGroup is not specified, the specified Kind must be in the core API group.
                          For any other third-party types, APIGroup is required.
                        type: string
                      kind:
                        description: Kind is the type of resource being referenced
                        type: string
                      name:
                        description: Name is the name of resource being referenced
                        type: string
                      namespace:
                        description: |-
                          Namespace is the namespace of resource being referenced
                          Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
                          (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
                        type: string
                    required:
                    - kind
                    - name
                    type: object
                  resources:
                    description: |-
                      resources represents the minimum resources the volume should have.
                      Users are allowed to specify resource requirements
                      that are lower than previous value but must still be higher than capacity recorded in the
                      status field of the claim.
                      More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
                    properties:
                      limits:
                        additionalProperties:
                          anyOf:
                          - type: integer
                          - type: string
                          pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                          x-kubernetes-int-or-string: true
                        description: |-
                          Limits describes the maximum amount of compute resources allowed.
                          More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
                        type: object
                      requests:
                        additionalProperties:
                          anyOf:
                          - type: integer
                          - type: string
                          pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                          x-kubernetes-int-or-string: true
                        description: |-
                          Requests describes the minimum amount of compute resources required.
                          If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
                          otherwise to an implementation-defined value. Requests cannot exceed Limits.
                          More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
                        type: object
                    type: object
                  selector:
                    description: selector is a label query over volumes to consider
                      for binding.
                    properties:
                      matchExpressions:
                        description: matchExpressions is a list of label selector
                          requirements. The requirements are ANDed.
                        items:
                          description: |-
                            A label selector requirement is a selector that contains values, a key, and an operator that
                            relates the key and values.
                          properties:
                            key:
                              description: key is the label key that the selector
                                applies to.
                              type: string
                            operator:
                              description: |-
                                operator represents a key's relationship to a set of values.
                                Valid operators are In, NotIn, Exists and DoesNotExist.
                              type: string
                            values:
                              description: |-
                                values is an array of string values. If the operator is In or NotIn,
                                the values array must be non-empty. If the operator is Exists or DoesNotExist,
                                the values array must be empty. This array is replaced during a strategic
                                merge patch.
                              items:
                                type: string
                              type: array
                              x-kubernetes-list-type: atomic
                          required:
                          - key
                          - operator
                          type: object
                        type: array
                        x-kubernetes-list-type: atomic
                      matchLabels:
                        additionalProperties:
                          type: string
                        description: |-
                          matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
                          map is equivalent to an element of matchExpressions, whose key field is "key", the
                          operator is "In", and the values array contains only "value". The requirements are ANDed.
                        type: object
                    type: object
                    x-kubernetes-map-type: atomic
                  storageClassName:
                    description: |-
                      storageClassName is the name of the StorageClass required by the claim.
                      More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
                    type: string
                  volumeAttributesClassName:
                    description: |-
                      volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
                      If specified, the CSI driver will create or update the volume with the attributes defined
                      in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
                      it can be changed after the claim is created. An empty string or nil value indicates that no
                      VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state,
                      this field can be reset to its previous value (including nil) to cancel the modification.
                      If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
                      set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
                      exists.
                      More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/
                    type: string
                  volumeMode:
                    description: |-
                      volumeMode defines what type of volume is required by the claim.
                      Value of Filesystem is implied when not included in claim spec.
                    type: string
                  volumeName:
                    description: volumeName is the binding reference to the PersistentVolume
                      backing this claim.
                    type: string
                type: object
              currentStep:
                properties:
                  beginTime:
                    format: date-time
                    type: string
                  duration:
                    type: string
                  endTime:
                    format: date-time
                    type: string
                  options:
                    additionalProperties:
                      type: string
                    type: object
                  processor:
                    type: string
                required:
                - processor
                type: object
              duration:
                type: string
              endTime:
                format: date-time
                type: string
              nextSteps:
                items:
                  properties:
                    beginTime:
                      format: date-time
                      type: string
                    duration:
                      type: string
                    endTime:
                      format: date-time
                      type: string
                    options:
                      additionalProperties:
                        type: string
                      type: object
                    processor:
                      type: string
                  required:
                  - processor
                  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
              vmstorageSts:
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
