Summary
When manage_storage_network = true, the null_resource.storage_network provisioner relies on KUBECONFIG being set to var.harvester_kubeconfig_path. There is currently no validation ensuring this variable is non-empty, which will cause kubectl to fail silently or with an unhelpful error.
Required Change
Add a check block (or a precondition) in modules/bootstrap/main.tf to enforce that harvester_kubeconfig_path is non-empty whenever manage_storage_network = true. Example:
check "storage_network_kubeconfig_required" {
assert {
condition = !var.manage_storage_network || var.harvester_kubeconfig_path != ""
error_message = "harvester_kubeconfig_path is required when manage_storage_network = true."
}
}
Context
References
Summary
When
manage_storage_network = true, thenull_resource.storage_networkprovisioner relies onKUBECONFIGbeing set tovar.harvester_kubeconfig_path. There is currently no validation ensuring this variable is non-empty, which will causekubectlto fail silently or with an unhelpful error.Required Change
Add a
checkblock (or aprecondition) inmodules/bootstrap/main.tfto enforce thatharvester_kubeconfig_pathis non-empty whenevermanage_storage_network = true. Example:Context
modules/bootstrap/main.tf,null_resource.storage_networkresourcevar.manage_storage_network,var.harvester_kubeconfig_pathReferences