{
  "description": "ImageCatalog is the Schema for the imagecatalogs API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "additionalProperties": false,
      "description": "Specification of the desired behavior of the ImageCatalog.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
      "properties": {
        "images": {
          "description": "List of CatalogImages available in the catalog",
          "items": {
            "additionalProperties": false,
            "description": "CatalogImage defines the image and major version",
            "properties": {
              "extensions": {
                "description": "The configuration of the extensions to be added",
                "items": {
                  "additionalProperties": false,
                  "description": "ExtensionConfiguration is the configuration used to add\nPostgreSQL extensions to the Cluster.",
                  "properties": {
                    "bin_path": {
                      "description": "A list of directories within the image to be appended to the\nPostgreSQL process's `PATH` environment variable.",
                      "items": {
                        "type": "string"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    },
                    "dynamic_library_path": {
                      "description": "The list of directories inside the image which should be added to dynamic_library_path.\nIf not defined, defaults to \"/lib\".",
                      "items": {
                        "type": "string"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    },
                    "env": {
                      "description": "Env is a list of custom environment variables to be set in the\nPostgreSQL process for this extension. It is the responsibility of the\ncluster administrator to ensure the variables are correct for the\nspecific extension. Note that changes to these variables require\na manual cluster restart to take effect.",
                      "items": {
                        "additionalProperties": false,
                        "description": "ExtensionEnvVar defines an environment variable for a specific extension\nimage volume.",
                        "properties": {
                          "name": {
                            "description": "Name of the environment variable to be injected into the\nPostgreSQL process.",
                            "minLength": 1,
                            "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
                            "type": "string"
                          },
                          "value": {
                            "description": "Value of the environment variable. CloudNativePG performs a direct\nreplacement of this value, with support for placeholder expansion.\nThe ${`image_root`} placeholder resolves to the absolute mount path\nof the extension's volume (e.g., `/extensions/my-extension`). This\nis particularly useful for allowing applications or libraries to\nlocate specific directories within the mounted image.\nUnrecognized placeholders are rejected. To include a literal ${...}\nin the value, escape it as $${...}.",
                            "minLength": 1,
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "value"
                        ],
                        "type": "object"
                      },
                      "type": [
                        "array",
                        "null"
                      ],
                      "x-kubernetes-list-map-keys": [
                        "name"
                      ],
                      "x-kubernetes-list-type": "map"
                    },
                    "extension_control_path": {
                      "description": "The list of directories inside the image which should be added to extension_control_path.\nIf not defined, defaults to \"/share\".",
                      "items": {
                        "type": "string"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    },
                    "image": {
                      "additionalProperties": false,
                      "description": "The image containing the extension.",
                      "properties": {
                        "pullPolicy": {
                          "description": "Policy for pulling OCI objects. Possible values are:\nAlways: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails.\nNever: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present.\nIfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\nDefaults to Always if :latest tag is specified, or IfNotPresent otherwise.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "reference": {
                          "description": "Required: Image or artifact reference to be used.\nBehaves in the same way as pod.spec.containers[*].image.\nPull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets.\nMore info: https://kubernetes.io/docs/concepts/containers/images\nThis field is optional to allow higher level config management to default or override\ncontainer images in workload controllers like Deployments and StatefulSets.",
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "ld_library_path": {
                      "description": "The list of directories inside the image which should be added to ld_library_path.",
                      "items": {
                        "type": "string"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    },
                    "name": {
                      "description": "The name of the extension, required",
                      "minLength": 1,
                      "pattern": "^[a-z0-9]([-a-z0-9_]*[a-z0-9])?$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ],
                "x-kubernetes-list-map-keys": [
                  "name"
                ],
                "x-kubernetes-list-type": "map"
              },
              "image": {
                "description": "The image reference",
                "type": "string"
              },
              "major": {
                "description": "The PostgreSQL major version of the image. Must be unique within the catalog.",
                "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"
}