apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: approvals.tmax.io
spec:
  group: tmax.io
  names:
    kind: Approval
    listKind: ApprovalList
    plural: approvals
    singular: approval
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: Approval is the Schema for the approvals 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: ApprovalSpec defines the desired state of Approval
            properties:
              accessPath:
                type: string
              podIP:
                description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
                  Important: Run "operator-sdk generate k8s" to regenerate code after
                  modifying this file Add custom validation using kubebuilder tags:
                  https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
                type: string
              port:
                format: int32
                type: integer
              threshold:
                format: int32
                type: integer
              users:
                additionalProperties:
                  type: string
                type: object
            required:
            - podIP
            - users
            type: object
          status:
            properties:
              approvers:
                items:
                  properties:
                    approvedTime:
                      format: date-time
                      type: string
                    decision:
                      description: DecisionType field should have Approved or Rejected.
                      enum:
                      - Approved
                      - Rejected
                      type: string
                    userId:
                      type: string
                  required:
                  - approvedTime
                  - decision
                  - userId
                  type: object
                type: array
              conditions:
                items:
                  description: to seperate conditions and our status. conditions will
                    be replaced by knative.conditions
                  properties:
                    lastTransitionTime:
                      description: LastTransitionTime is the last time the condition
                        transitioned from one status to another. We use VolatileTime
                        in place of metav1.Time to exclude this from creating equality.Semantic
                        differences (all other things held constant).
                      format: date-time
                      type: string
                    message:
                      description: A human readable message indicating details about
                        the transition.
                      type: string
                    reason:
                      description: The reason for the condition's last transition.
                      type: string
                    status:
                      description: Status of the condition, one of True, False, Unknown.
                      type: string
                    type:
                      description: Type of condition.
                      type: string
                  required:
                  - status
                  - type
                  type: object
                type: array
              retry:
                default: 0
                format: int32
                type: integer
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
