feat(bootstrap): add validation for harvester_kubeconfig_path when manage_storage_network is true

Open Beginner friendly
#87 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
terraform

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.

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

References

Dominant language
HCL
Stars
19
Forks
15
Avg merge
2d 2h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wso2/open-cloud-datacenter

All issues in wso2/open-cloud-datacenter

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.