apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: controlplanes.extensions.gardener.cloud
  labels:
    gardener.cloud/deletion-protected: "true"
spec:
  group: extensions.gardener.cloud
  versions:
  - name: v1alpha1
    served: true
    storage: true
  version: v1alpha1
  scope: Namespaced
  names:
    plural: controlplanes
    singular: controlplane
    kind: ControlPlane
    shortNames:
    - cp
  additionalPrinterColumns:
  - name: Type
    type: string
    description: The control plane type.
    JSONPath: .spec.type
  - name: Purpose
    type: string
    description: Purpose of control plane resource.
    JSONPath: .spec.purpose
  - name: Status
    type: string
    description: Status of control plane resource.
    JSONPath: .status.lastOperation.state
  - name: Age
    type: date
    JSONPath: .metadata.creationTimestamp
  subresources:
    status: {}
  validation:
    openAPIV3Schema:
      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/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: httpregios://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
          type: string
        metadata:
          type: object
        spec:
          properties:
            type:
              description: The type of this control plane.
              type: string
            providerConfig:
              description: Provider-specific configuration for this control plane.
              type: object
            purpose:
              description: Purpose contains the data if a cloud provider needs additional
                components in order to expose the control plane.
              type: string
            infrastructureProviderStatus:
              description: The provider status that has been generated by the controller responsible for the `Infrastructure` resource.
              type: object
            region:
              description: The region of this control plane.
              type: string
            secretRef:
              description: A reference to a secret that contains the cloud provider specific credentials.
              properties:
                name:
                  type: string
                namespace:
                  type: string
              required:
              - name
              - namespace
              type: object
          required:
          - type
          - region
          - secretRef
          type: object
        status:
          properties:
            lastError:
              description: LastError holds information about the last occurred error
                during an operation.
              properties:
                codes:
                  description: Well-defined error codes of the last error(s).
                  items:
                    type: string
                  type: array
                description:
                  description: A human readable message indicating details about the
                    last error.
                  type: string
                lastUpdateTime:
                  description: Last time the error was reported
                  format: date-time
                  type: string
              required:
              - description
              type: object
            lastOperation:
              description: LastOperation holds information about the last operation
                on the resource.
              properties:
                description:
                  description: A human readable message indicating details about the
                    last operation.
                  type: string
                lastUpdateTime:
                  description: Last time the operation state transitioned from one
                    to another.
                  format: date-time
                  type: string
                progress:
                  description: The progress in percentage (0-100) of the last operation.
                  format: int64
                  type: integer
                state:
                  description: Status of the last operation, one of Aborted, Processing,
                    Succeeded, Error, Failed.
                  type: string
                type:
                  description: Type of the last operation, one of Create, Reconcile,
                    Delete.
                  type: string
              required:
              - description
              - lastUpdateTime
              - progress
              - state
              - type
              type: object
            observedGeneration:
              description: ObservedGeneration is the most recent generation observed
                for this resource.
              format: int64
              type: integer
            state:
              description: State can be filled by the operating controller with what
                ever data it needs.
              type: object
            providerStatus:
              description: Provider-specific output for this control plane
              type: object
          type: object
      required:
      - spec
