# see https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
# TODO: rename to app8s
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: applications.k8spkg.mgoltzsche.github.com
spec:
  group: k8spkg.mgoltzsche.github.com
  scope: Namespaced
  names:
    plural: applications
    singular: application
    kind: Application
    shortNames:
      - app
  versions:
    - name: v1alpha1
      # Each version can be enabled/disabled by Served flag.
      served: true
      # One and only one version must be marked as the storage version.
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              required:
                - resources
              properties:
                resources:
                  type: array
                  items:
                    type: object
                    required:
                      - apiVersion
                      - kind
                      - name
                    properties:
                      apiVersion:
                        type: string
                      kind:
                        type: string
                      name:
                        type: string
                      namespace:
                        type: string