{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Helm Chart Values Schema",
  "type": "object",
  "properties": {
    "turtlesUI": {
      "type": "object",
      "description": "Manages the UI component.",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": false,
          "description": "Turn UI on or off."
        },
        "version": {
          "type": "string",
          "default": "0.8.2",
          "description": "UI version to use."
        }
      }
    },
    "rancherTurtles": {
      "type": "object",
      "description": "Sets up the cluster management controller.",
      "properties": {
        "image": {
          "type": "string",
          "default": "controller",
          "description": "Controller container image."
        },
        "imageVersion": {
          "type": "string",
          "default": "v0.0.0",
          "description": "Image tag."
        },
        "imagePullPolicy": {
          "type": "string",
          "default": "IfNotPresent",
          "description": "Specify image pull policy."
        },
        "namespace": {
          "type": "string",
          "default": "rancher-turtles-system",
          "description": "Namespace for Turtles to run."
        },
        "managerArguments": {
          "type": "array",
          "default": [],
          "description": "Extra args for the controller.",
          "items": { "type": "string" }
        },
        "imagePullSecrets": {
          "type": "array",
          "default": [],
          "description": "Secrets for private registries.",
          "items": { "type": "string" }
        },
        "rancherInstalled": {
          "type": "boolean",
          "default": true,
          "description": "True if Rancher is already installed in the cluster."
        },
        "kubectlImage": {
          "type": "string",
          "default": "registry.k8s.io/kubernetes/kubectl:v1.31.4",
          "description": "Image for kubectl tasks."
        },
        "features": {
          "type": "object",
          "description": "Optional and experimental features.",
          "properties": {
            "day2operations": {
              "type": "object",
              "description": "Alpha feature.",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": false,
                  "description": "Turn on or off."
                },
                "image": {
                  "type": "string",
                  "default": "controller",
                  "description": "Image for day-2 ops."
                },
                "imageVersion": {
                  "type": "string",
                  "default": "v0.0.0",
                  "description": "Image tag."
                },
                "imagePullPolicy": {
                  "type": "string",
                  "default": "IfNotPresent",
                  "description": "Specify image pull policy."
                },
                "etcdBackupRestore": {
                  "type": "object",
                  "description": "Manages etcd backup/restore.",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "default": false,
                      "description": "Turn on (true) or off (false)."
                    }
                  }
                }
              }
            },
            "addon-provider-fleet": {
              "type": "object",
              "description": "Beta feature for fleet addons.",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": true,
                  "description": "Turn on or off."
                }
              }
            },
            "agent-tls-mode": {
              "type": "object",
              "description": "Alpha feature for agent TLS.",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": false,
                  "description": "Turn on or off."
                }
              }
            },
            "clusterclass-operations": {
              "type": "object",
              "description": "Alpha feature. Not ready for testing yet.",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": false,
                  "description": "Turn on or off."
                },
                "image": {
                  "type": "string",
                  "default": "controller",
                  "description": "Image for cluster class ops."
                },
                "imageVersion": {
                  "type": "string",
                  "default": "v0.0.0",
                  "description": "Image tag."
                },
                "imagePullPolicy": {
                  "type": "string",
                  "default": "IfNotPresent",
                  "description": "Pull policy."
                }
              }
            }
          }
        },
        "volumes": {
          "type": "array",
          "description": "Volumes for controller pods.",
          "items": {
            "type": "object",
            "required": [
              "name",
              "configMap"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "configMap": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "default": "clusterctl-config",
                    "description": "ConfigMap for clusterctl."
                  }
                }
              }
            }
          }
        },
        "volumeMounts": {
          "type": "object",
          "properties": {
            "manager": {
              "type": "array",
              "description": "Mount volumes to pods.",
              "items": {
                "type": "object",
                "properties": {
                  "mountPath": { "type": "string" },
                  "name": { "type": "string" },
                  "readOnly": {
                    "type": "boolean",
                    "default": true,
                    "description": "Mount as read-only."
                  }
                }
              }
            }
          }
        }
      }
    },
    "cluster-api-operator": {
      "type": "object",
      "description": "Manages Cluster API components.",
      "properties": {
        "cleanup": {
          "type": "boolean",
          "default": true,
          "description": "Enable cleanup tasks."
        },
        "cluster-api": {
          "type": "object",
          "description": "Cluster API component settings.",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true,
              "description": "Turn on or off."
            },
            "configSecret": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "default": "",
                  "description": "Custom secret name (if overriding)."
                },
                "defaultName": {
                  "type": "string",
                  "default": "capi-env-variables",
                  "description": "Default secret name."
                }
              }
            },
            "core": {
              "type": "object",
              "properties": {
                "namespace": {
                  "type": "string",
                  "default": "capi-system",
                  "description": "Core component namespace."
                },
                "imageUrl": {
                  "type": "string",
                  "default": "",
                  "description": "Custom image URL."
                },
                "fetchConfig": {
                  "type": "object",
                  "properties": {
                    "url": { "type": "string", "default": "" },
                    "selector": { "type": "string", "default": "" }
                  }
                },
                "enableAutomaticUpdates": {
                  "type": "boolean",
                  "default": true,
                  "description": "Allow the provider to update automatically when a new Turtles version is installed."
                },
                "version": {
                  "type": "string",
                  "default": "",
                  "description": "CAPI core provider version."
                }
              }
            },
            "rke2": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": true,
                  "description": "Turn on or off."
                },
                "version": {
                  "type": "string",
                  "default": "",
                  "description": "RKE2 version."
                },
                "enableAutomaticUpdates": {
                  "type": "boolean",
                  "default": true,
                  "description": "Allow the provider to update automatically when a new Turtles version is installed."
                },
                "bootstrap": {
                  "type": "object",
                  "properties": {
                    "namespace": {
                      "type": "string",
                      "default": "rke2-bootstrap-system"
                    },
                    "imageUrl": { "type": "string", "default": "" },
                    "fetchConfig": {
                      "type": "object",
                      "properties": {
                        "url": { "type": "string", "default": "" },
                        "selector": { "type": "string", "default": "" }
                      }
                    }
                  }
                },
                "controlPlane": {
                  "type": "object",
                  "properties": {
                    "namespace": {
                      "type": "string",
                      "default": "rke2-control-plane-system"
                    },
                    "imageUrl": { "type": "string", "default": "" },
                    "fetchConfig": {
                      "type": "object",
                      "properties": {
                        "url": { "type": "string", "default": "" },
                        "selector": { "type": "string", "default": "" }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
