{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Helm Chart Values Schema",
  "$defs": {
    "providerSchema": {
      "type": "object",
      "description": "Provider configuration.",
      "required": [
        "enabled",
        "namespace"
      ],
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Enables the installation of this provider."
        },
        "namespace": {
          "type": "string",
          "description": "The namespace where the provider manifests will be applied."
        },
        "enableAutomaticUpdate": {
          "type": "boolean",
          "description": "Allows the provider to be updated automatically whenever this chart is updated."
        },
        "version": {
          "type": "string",
          "description": "Optional provider version."
        },
        "credentials": {
          "type": "object",
          "description": "Optional Secret reference containing Rancher credentials",
          "required": [
            "name",
            "namespace"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "The name of the Rancher Cloud credential."
            },
            "namespace": {
              "type": "string",
              "description": "The namespace of the Rancher Cloud credential."
            }
          }
        },
        "configSecret": {
          "type": "object",
          "description": "ConfigSecret is the object with name and namespace of the Secret providing the configuration variables for the current provider instance, like e.g. credentials.",
          "required": [
            "name",
            "namespace"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "The name of the Secret containing the provider configuration variables."
            },
            "namespace": {
              "type": "string",
              "description": "The namespace of the Secret containing the provider configuration variables."
            }
          }
        },
        "features": {
          "type": "object",
          "description": "Optional feature flags for this provider.",
          "properties": {
            "machinePool": {
              "type": "boolean",
              "description": "Enables CAPI MachinePool support."
            },
            "clusterResourceSet": {
              "type": "boolean",
              "description": "Enables CAPI ClusterResourceSet support."
            },
            "clusterTopology": {
              "type": "boolean",
              "description": "Enables CAPI ClusterClass support."
            }
          }
        },
        "variables": {
          "type": "object",
          "description": "Optional environment variables exposed to the controller manager.",
          "additionalProperties": {
            "type": "string"
          }
        },
        "manager": {
          "type": "object",
          "description": "Optional controller manager settings.",
          "properties": {
            "syncPeriod": {
              "type": "string",
              "description": "Controller sync period duration, e.g. '5m'"
            },
            "verbosity": {
              "type": "number",
              "description": "Verbosity set the logs verbosity. Defaults to 1.",
              "minimum": 1,
              "maximum": 5
            }
          }
        }
      }
    }
  },
  "type": "object",
  "properties": {
    "providers": {
      "type": "object",
      "description": "Providers configuration.",
      "properties": {
        "addonFleet": {
          "$ref": "#/$defs/providerSchema"
        },
        "bootstrapRKE2": {
          "$ref": "#/$defs/providerSchema"
        },
        "controlplaneRKE2": {
          "$ref": "#/$defs/providerSchema"
        },
        "infrastructureMetal3": {
          "$ref": "#/$defs/providerSchema"
        },
        "ipamMetal3": {
          "$ref": "#/$defs/providerSchema"
        }
      }
    }
  }
}
