{
  "$defs": {
    "ResolvedJsonValue": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "boolean"
        },
        {
          "type": "number"
        },
        {
          "type": "string"
        },
        {
          "items": {
            "$ref": "#/$defs/ResolvedJsonValue"
          },
          "type": "array"
        },
        {
          "additionalProperties": {
            "$ref": "#/$defs/ResolvedJsonValue"
          },
          "propertyNames": {
            "not": {
              "enum": [
                "fromArtifact",
                "fromEnvironment",
                "fromPromotion",
                "fromReceipt"
              ]
            }
          },
          "type": "object"
        }
      ]
    }
  },
  "$id": "https://niklasrosenstein.github.io/gitopsctr/schemas/apis/unit.gitopsctr.io/v1/OciImages/desired.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string"
    },
    "apiVersion": {
      "const": "unit.gitopsctr.io/v1"
    },
    "kind": {
      "const": "OciImages"
    },
    "metadata": {
      "additionalProperties": false,
      "not": {
        "properties": {
          "labels": {
            "required": [
              "gitopsctr.io/partition"
            ]
          }
        },
        "required": [
          "ownerReferences",
          "labels"
        ]
      },
      "properties": {
        "deletion": {
          "additionalProperties": false,
          "properties": {
            "generation": {
              "minimum": 1,
              "type": "integer"
            },
            "resourceDigest": {
              "pattern": "^sha256:[0-9a-f]{64}$",
              "type": "string"
            }
          },
          "required": [
            "generation",
            "resourceDigest"
          ],
          "title": "DeletionMetadata",
          "type": "object"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "properties": {
            "gitopsctr.io/partition": {
              "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
              "type": "string"
            }
          },
          "propertyNames": {
            "type": "string"
          },
          "type": "object"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        },
        "ownerReferences": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "apiVersion": {
                "minLength": 1,
                "type": "string"
              },
              "kind": {
                "minLength": 1,
                "type": "string"
              },
              "name": {
                "minLength": 1,
                "type": "string"
              },
              "uid": {
                "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
                "type": "string"
              }
            },
            "required": [
              "apiVersion",
              "kind",
              "name",
              "uid"
            ],
            "title": "DesiredOwnerReference",
            "type": "object"
          },
          "maxItems": 1,
          "minItems": 1,
          "type": "array"
        },
        "uid": {
          "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
          "type": "string"
        }
      },
      "required": [
        "name",
        "uid"
      ],
      "type": "object"
    },
    "spec": {
      "additionalProperties": false,
      "properties": {
        "build": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "dockerfile": {
                  "type": "string"
                },
                "platform": {
                  "type": "string"
                }
              },
              "required": [
                "dockerfile",
                "platform"
              ],
              "title": "OciBuild",
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "inputs": {
          "anyOf": [
            {
              "additionalProperties": {
                "$ref": "#/$defs/ResolvedJsonValue"
              },
              "propertyNames": {
                "not": {
                  "enum": [
                    "fromArtifact",
                    "fromEnvironment",
                    "fromPromotion",
                    "fromReceipt"
                  ]
                }
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "publish": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "credentialProvider": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "type": {
                          "const": "aws-ecr"
                        }
                      },
                      "required": [
                        "type"
                      ],
                      "title": "AwsEcrCredentialProvider",
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                },
                "targets": {
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "repository": {
                            "type": "string"
                          },
                          "type": {
                            "const": "registry"
                          }
                        },
                        "required": [
                          "type",
                          "repository"
                        ],
                        "title": "RegistryTarget",
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "cluster": {
                            "type": "string"
                          },
                          "type": {
                            "const": "kind"
                          }
                        },
                        "required": [
                          "type",
                          "cluster"
                        ],
                        "title": "KindTarget",
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "profile": {
                            "type": "string"
                          },
                          "type": {
                            "const": "minikube"
                          }
                        },
                        "required": [
                          "type",
                          "profile"
                        ],
                        "title": "MinikubeTarget",
                        "type": "object"
                      }
                    ]
                  },
                  "propertyNames": {
                    "type": "string"
                  },
                  "type": "object"
                }
              },
              "required": [
                "targets"
              ],
              "title": "OciPublication",
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "resolvedInputs": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "artifacts": {
                  "anyOf": [
                    {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "propertyNames": {
                        "type": "string"
                      },
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                },
                "importedArtifactEvidence": {
                  "anyOf": [
                    {
                      "additionalProperties": {
                        "type": "object"
                      },
                      "propertyNames": {
                        "type": "string"
                      },
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                },
                "importedArtifacts": {
                  "anyOf": [
                    {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "propertyNames": {
                        "type": "string"
                      },
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                },
                "promotions": {
                  "anyOf": [
                    {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "propertyNames": {
                        "type": "string"
                      },
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                },
                "receipts": {
                  "anyOf": [
                    {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "propertyNames": {
                        "type": "string"
                      },
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null
                }
              },
              "title": "ResolvedInputs",
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "source": {
          "additionalProperties": false,
          "properties": {
            "driverVersion": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "inputHash": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null
            },
            "inputs": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Input paths or glob patterns resolved relative to source.path."
            },
            "path": {
              "description": "Repository-relative path resolved from the root of the selected source revision.",
              "type": "string"
            },
            "revision": {
              "pattern": "^[0-9a-f]{40}$",
              "type": "string"
            }
          },
          "required": [
            "path",
            "revision"
          ],
          "title": "DesiredSource",
          "type": "object"
        }
      },
      "required": [
        "source"
      ],
      "type": "object"
    }
  },
  "required": [
    "apiVersion",
    "kind",
    "metadata",
    "spec"
  ],
  "title": "OciImages (unit.gitopsctr.io/v1)",
  "type": "object"
}
