---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.17.2
    helm.sh/resource-policy: keep
  name: imagecatalogs.postgresql.cnpg.io
spec:
  group: postgresql.cnpg.io
  names:
    kind: ImageCatalog
    listKind: ImageCatalogList
    plural: imagecatalogs
    singular: imagecatalog
  scope: Namespaced
  versions:
    - additionalPrinterColumns:
        - jsonPath: .metadata.creationTimestamp
          name: Age
          type: date
      name: v1
      schema:
        openAPIV3Schema:
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              properties:
                images:
                  items:
                    properties:
                      image:
                        type: string
                      major:
                        minimum: 10
                        type: integer
                    required:
                      - image
                      - major
                    type: object
                  maxItems: 8
                  minItems: 1
                  type: array
                  x-kubernetes-validations:
                    - message: Images must have unique major versions
                      rule: self.all(e, self.filter(f, f.major==e.major).size() == 1)
              required:
                - images
              type: object
          required:
            - metadata
            - spec
          type: object
      served: true
      storage: true
      subresources: {}
