apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: tenants.steward.sap.com
spec:
  group: steward.sap.com
  names:
    kind: Tenant
    singular: tenant
    plural: tenants
    shortNames:
    - stn
    - stns
  scope: Namespaced
  versions:
  - name: v1alpha1
    served: true
    storage: true
    schema:
      openAPIV3Schema:
        type: object
        properties:
          "status":
            type: object
            x-kubernetes-preserve-unknown-fields: true
    subresources:
      status: {}
    additionalPrinterColumns:
    - name: Ready
      type: string
      jsonPath: |-
        .status.conditions[?(@.type=="Ready")].status
    - name: Reason
      type: string
      jsonPath: |-
        .status.conditions[?(@.type=="Ready")].reason
      priority: 1
    - name: Message
      type: string
      jsonPath: |-
        .status.conditions[?(@.type=="Ready")].message
      priority: 1
    - name: Tenant-Namespace
      type: string
      description: The name of the namespace for this tenant.
      jsonPath: |-
        .status.tenantNamespaceName
    - name: Age
      type: date
      jsonPath: |-
        .metadata.creationTimestamp
