wso2 / wso2/open-cloud-datacenter
feat(bootstrap): add validation for harvester_kubeconfig_path when manage_storage_network is true
Nobody has claimed this yet.
- Dominant language
- HCL
- Stars
- 19
- Forks
- 15
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 4
Description
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
- Identified in PR #84 (comment: https://github.com/wso2/open-cloud-datacenter/pull/84#discussion_r3167420908)
- File:
modules/bootstrap/main.tf,null_resource.storage_networkresource - Variables involved:
var.manage_storage_network,var.harvester_kubeconfig_path
References
- PR: https://github.com/wso2/open-cloud-datacenter/pull/84
- Requested by: @HiranAdikari
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in modules/bootstrap/main.tf by reading the null_resource.storage_network resource and the definitions of manage_storage_network and harvester_kubeconfig_path. Confirm that an enabled storage network with an empty kubeconfig path fails validation, while disabled management and non-empty values remain valid, then run Terraform validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- terraform
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100