apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: prowjobs.prow.k8s.io
spec:
  group: prow.k8s.io
  version: v1
  names:
    kind: ProwJob
    singular: prowjob
    plural: prowjobs
  scope: Namespaced
  validation:
    openAPIV3Schema:
      properties:
        spec:
          properties:
            max_concurrency:
              type: integer
              minimum: 0
            type:
              type: string
              enum:
              - "presubmit"
              - "postsubmit"
              - "periodic"
              - "batch"
        status:
          properties:
            state:
              type: string
              enum:
              - "triggered"
              - "pending"
              - "success"
              - "failure"
              - "aborted"
              - "error"
          anyOf:
          - not:
              properties:
                state:
                  type: string
                  enum:
                  - "success"
                  - "failure"
                  - "error"
                  - "aborted"
          - required:
            - completionTime

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: prowjobs.prow.k8s.io
spec:
  group: prow.k8s.io
  version: v1
  names:
    kind: ProwJob
    singular: prowjob
    plural: prowjobs
  scope: Namespaced
  validation:
    openAPIV3Schema:
      properties:
        spec:
          properties:
            max_concurrency:
              type: integer
              minimum: 0
            type:
              type: string
              enum:
              - "presubmit"
              - "postsubmit"
              - "periodic"
              - "batch"
        status:
          properties:
            state:
              type: string
              enum:
              - "triggered"
              - "pending"
              - "success"
              - "failure"
              - "aborted"
              - "error"
          anyOf:
          - not:
              properties:
                state:
                  type: string
                  enum:
                  - "success"
                  - "failure"
                  - "error"
                  - "aborted"
          - required:
            - completionTime
  additionalPrinterColumns:
  - name: Job
    type: string
    description: The name of the job being run.
    JSONPath: .spec.job
  - name: BuildId
    type: string
    description: The ID of the job being run.
    JSONPath: .status.build_id
  - name: Type
    type: string
    description: The type of job being run.
    JSONPath: .spec.type
  - name: Org
    type: string
    description: The org for which the job is running.
    JSONPath: .spec.refs.org
  - name: Repo
    type: string
    description: The repo for which the job is running.
    JSONPath: .spec.refs.repo
  - name: Pulls
    type: string
    description: The pulls for which the job is running.
    JSONPath: ".spec.refs.pulls[*].number"
  - name: StartTime
    type: date
    description: When the job started running.
    JSONPath: .status.startTime
  - name: CompletionTime
    type: date
    description: When the job finished running.
    JSONPath: .status.completionTime

Add custom fields to the CRD definition for better admin UX
Add custom fields to the CRD definition for better admin UX

Signed-off-by: Steve Kuznetsov <a7da0fca91d9933d2725d731a48cabdc9e8ffd7a@redhat.com>
