---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.16.3
  name: workflows.cloud.pingcap.com
spec:
  group: cloud.pingcap.com
  names:
    kind: Workflow
    listKind: WorkflowList
    plural: workflows
    shortNames:
    - wf
    singular: workflow
  preserveUnknownFields: false
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.type
      name: Type
      type: string
    - jsonPath: .spec.paused
      name: Paused
      type: boolean
    - jsonPath: .status.phase
      name: Phase
      type: string
    - jsonPath: .status.progress
      name: Progress
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: AGE
      type: date
    - jsonPath: .status.runningSteps
      name: RunningSteps
      type: date
    name: v1
    schema:
      openAPIV3Schema:
        description: Workflow is the Schema for the workflows 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:
            properties:
              inputs:
                additionalProperties:
                  type: string
                type: object
              paused:
                default: false
                description: Paused indicates if the workflow instance is paused.
                type: boolean
              retryPolicy:
                description: default to Always
                properties:
                  backoff:
                    description: Backoff is duration string such as '30s', means wait
                      how long to do next retry when encounter error for a step
                    type: string
                  type:
                    enum:
                    - Always
                    - Never
                    type: string
                required:
                - type
                type: object
              schedule:
                description: |-
                  execute this workflow at specific time
                  should be `2006-01-02T15:04:05Z`.
                format: date-time
                type: string
              steps:
                description: WorkflowSteps is a FIFO queue of upgrade steps.
                items:
                  properties:
                    inputs:
                      description: Inputs is inputs of this step
                      type: object
                      x-kubernetes-preserve-unknown-fields: true
                    name:
                      description: Name acts as the unique key of this step in a Workflow
                        Instance
                      type: string
                    uses:
                      description: Uses represents which Workflow Action to be used
                      type: string
                  required:
                  - name
                  - uses
                  type: object
                type: array
              ttl:
                default: 8760h
                description: |-
                  Wait how long to GC a finished Workflow CR
                  TTL is the time to live for Completed/Failed Workflow CRs.
                  Value must be in units accepted by Go time.ParseDuration https://golang.org/pkg/time/#ParseDuration.
                  If unset, this defaults to 8760 hours (1 year).
                type: string
              type:
                type: string
            required:
            - steps
            - type
            type: object
          status:
            properties:
              beginTime:
                format: date-time
                type: string
              duration:
                type: string
              endTime:
                format: date-time
                type: string
              finishedSteps:
                items:
                  type: string
                type: array
              nextExecuteTime:
                description: NextExecuteTime is the next time to execute this workflow.
                  Empty means no limit.
                format: date-time
                type: string
              outputs:
                additionalProperties:
                  type: string
                type: object
              phase:
                enum:
                - Pending
                - Running
                - Completed
                - Failed
                type: string
              progress:
                description: |-
                  Progress means the overall progress of the workflow, such as '2/10'. The denominator is the total number of steps.
                  The numerator is the number of finished steps.
                type: string
              reason:
                type: string
              runningSteps:
                items:
                  type: string
                type: array
              steps:
                items:
                  properties:
                    beginTime:
                      format: date-time
                      type: string
                    count:
                      description: Count is execution count of this step
                      type: integer
                    duration:
                      type: string
                    endTime:
                      format: date-time
                      type: string
                    lastError:
                      type: string
                    name:
                      type: string
                    outputs:
                      additionalProperties:
                        type: string
                      type: object
                    phase:
                      default: Pending
                      enum:
                      - Pending
                      - Running
                      - Completed
                      - Failed
                      type: string
                    reason:
                      type: string
                  required:
                  - count
                  - name
                  type: object
                type: array
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
