wso2 / wso2/open-cloud-datacenter

fix(bootstrap): enforce harvester_kubeconfig_path when manage_storage_class = true

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

Nobody has claimed this yet.

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

Description

Summary

The variable harvester_kubeconfig_path in modules/bootstrap/variables.tf is documented as required when manage_storage_class = true, but no enforcement exists. This causes null_resource.patch_longhorn_sc in main.tf to run with an empty KUBECONFIG environment variable, resulting in a runtime failure.

Fix

Add a check block in modules/bootstrap/main.tf to enforce the requirement (cross-variable validations are not supported in variable blocks):

check "harvester_kubeconfig_path_required" {
  assert {
    condition     = !var.manage_storage_class || var.harvester_kubeconfig_path != ""
    error_message = "harvester_kubeconfig_path is required when manage_storage_class = true. Set KUBECONFIG to a valid Harvester kubeconfig path."
  }
}

References

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.

Research direction

Start in modules/bootstrap/main.tf and review the null_resource.patch_longhorn_sc behavior described in the issue, then compare it with the variable documentation in modules/bootstrap/variables.tf. Add the requested cross-variable validation and verify that storage-class management requires a non-empty kubeconfig path while the other case remains valid.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.