Skip to content

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

Description

@coderabbitai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions