apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: versionscatalogues.airshipit.org
spec:
  group: airshipit.org
  names:
    kind: VersionsCatalogue
    plural: versionscatalogues
    singular: versionscatalogue
  scope: Namespaced
  versions:
  - name: v1alpha1
    served: true
    storage: true
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              helm_repositories:
                description: 'helm_repositories defines Helm repositories required by
                  HelmReleases.'
                type: object
                additionalProperties:
                  description: 'The name of each key defined at this level should identify
                    a Helm repository. Each helm_repository object is required to have a
                    "url" key that specifies the location of the repository.'
                  type: object
                  required: [url]
                  properties:
                    url:
                      type: string
              charts:
                description: 'charts defines collections of Helm charts. The name of each
                  key in this section should identify a specific chart, and each chart
                  object must have "chart" and "version" properties defined.'
                type: object
                additionalProperties:
                  type: object
                  required: [chart, version]
                  properties:
                    chart:
                      type: string
                    version:
                      type: string
              files:
                description: 'files defines collections of files required by airshipctl
                  functions.'
                type: object
                additionalProperties:
                  description: 'The name of each key defined here should refer to the airshipctl
                    function in which the file will be used.'
                  type: object
                  additionalProperties:
                    description: 'The name of each key defined at this level should identify a
                      single file. Each file object is required to have a "url" property defined,
                      and may also define a "checksum" property.'
                    type: object
                    required: [url]
                    properties:
                      url:
                        type: string
                      checksum:
                        type: string
              capi_images:
                description: 'capi_images defines collections of images used by cluster API.
                  The name of each key in this section should correspond to the airshipctl
                  function in which the images will be used, such as "capm3". Each capi_image
                  object must have a "manager" and "auth_proxy" object, each of which must have
                  "repository" and "tag" properties defined. capi_images may also include an
                  optional "ipam-manager" object, which must also have "repository" and "tag"
                  properties defined.'
                type: object
                additionalProperties:
                  type: object
                  required: [manager, auth_proxy]
                  properties:
                    manager:
                      type: object
                      required: [repository, tag]
                      properties:
                        repository:
                          type: string
                        tag:
                          type: string
                    auth_proxy:
                      type: object
                      required: [repository, tag]
                      properties:
                        repository:
                          type: string
                        tag:
                          type: string
                    ipam-manager:
                      type: object
                      required: [repository, tag]
                      properties:
                        repository:
                          type: string
                        tag:
                          type: string
              images:
                description: 'images defines collections of images that are declared as complete
                  URLs rather than as a collection of discrete parts, such as "repository" and
                  "tag" or "sha". This section of the catalogue is organized by
                  airshipctl function -> Deployments in function -> images in Deployment.'
                type: object
                additionalProperties:
                  description: 'The name of each key defined here should refer to the airshipctl
                    function to which the collection of images belongs, such as "baremetal-operator".'
                  type: object
                  additionalProperties:
                    description: 'The name of each key defined here should refer to the Kubernetes
                      resource document into which an image will be substituted, such as a Deployment
                      or DaemonSet.'
                    type: object
                    additionalProperties:
                      description: 'The name of each key defined at this level should identify a single
                        image. Each image object is required to have an "image" property which specifies
                        the full URL for the image (i.e. repository/image:tag) as a single string.'
                      type: object
                      required: [image]
                      properties:
                        image:
                          type: string
              image_components:
                description: 'image_components defines images that are declared using the Helm-style
                  format that breaks image URLs into discrete parts, such as "repository" and "tag".
                  Images in this section of the catalogue are grouped by airshipctl function ->
                  images in function.'
                type: object
                additionalProperties:
                  description: 'The name of each key defined at this level should refer to the
                    airshipctl function to which a collection of images belongs, such as
                    "baremetal-operator".'
                  type: object
                  additionalProperties:
                    description: 'The name of each key defined at this level should identify a single
                      image. Each image object must have a "repository" property, and must have a
                      property named "tag", "hash", "sha", or "digest".'
                    type: object
                    required: [repository]
                    oneOf:
                    - required: ["tag"]
                    - required: ["hash"]
                    - required: ["sha"]
                    - required: ["digest"]
                    properties:
                      repository:
                        type: string
                      tag:
                        type: string
                      hash:
                        type: string
                      sha:
                        type: string
                      digest:
                        type: string
                      name:
                        description: 'Name is an optional property that is used to specify the name of
                          an image. Typically, this format is only needed for charts such as dex-aio,
                          which uses "repo", "name", and "tag" properties to declare images, rather
                          than the more commonly used "repository" and "tag". In such cases, "repository"
                          should contain only the name of the repository (e.g. "quay.io") and the "name"
                          property should contain the image name (e.g. "metal3-io/ironic").'
                        type: string
              kubernetes:
                description: 'Allows for the specification of the kubernetes version being used.'
                type: string
