{
    "$schema": "https://json-schema.org/draft-07/schema#",
    "properties": {
        "csp": {
            "description": "CSP to which the chart is deployed.",
            "enum": ["Azure", "GCP", "AWS", "QEMU"]
        },
        "GCP": {
            "description": "Config values required for deployment on GCP",
            "type": "object",
            "properties": {
                "image": {
                    "description": "Container image to use for the spawned pods.",
                    "type": "string"
                },
                "projectID": {
                    "description": "ID of the GCP project into which the cluster is deployed",
                    "type": "string",
                    "examples": ["demoproject-581925"]
                },
                "uid": {
                    "description": "Unique identifier for the cluster",
                    "type": "string"
                },
                "secretData": {
                    "description": "GCP service account key as a json-string",
                    "type": "string"
                },
                "subnetworkPodCIDR": {
                    "description": "CIDR Range for Pods in cluster",
                    "type": "string",
                    "examples": ["192.0.2.0/24"],
                    "pattern": "[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}"
                }
            },
            "required": [
                "image",
                "projectID",
                "uid",
                "secretData",
                "subnetworkPodCIDR"
            ]
        },
        "Azure": {
            "description": "Config values required for deployment on Azure",
            "type": "object",
            "properties": {
                "image": {
                    "description": "Container image to use for the spawned pods.",
                    "type": "string",
                    "examples": ["mcr.microsoft.com/oss/kubernetes/azure-cloud-controller-manager:latest"]
                },
                "azureConfig": {
                    "description": "Base64 encoded json string that hold required config parameters for Azure CCM.",
                    "type": "string"
                }
            },
            "required": [
                "image",
                "azureConfig"
            ]
        },
        "AWS": {
            "description": "Config values required for deployment on AWS",
            "type": "object",
            "properties": {
                "image": {
                    "description": "Container image to use for the spawned pods.",
                    "type": "string"
                }
            },
            "required": [
                "image"
            ]
        }
    },
    "required": [
        "csp"
    ],
    "allOf": [
        {
            "if": {
                "properties": { "csp": { "const": "GCP" } },
                "required": ["csp"]
            },
            "then": { "required": ["GCP"] }
        },
        {
            "if": {
                "properties": { "csp": { "const": "Azure" } },
                "required": ["csp"]
            },
            "then": { "required": ["Azure"] }
        },
        {
            "if": {
                "properties": { "csp": { "const": "AWS" } },
                "required": ["csp"]
            },
            "then": { "required": ["AWS"] }
        }
    ],
    "title": "Values",
    "type": "object"
}
