Skip to content

Commit 9d502de

Browse files
HiranAdikariclaude
andcommitted
Add non-empty validation for network_namespace_name
Guard against an empty string being passed as the network namespace override — coalesce accepts "" as truthy so validation is the right fix, consistent with other string variables in this module. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 42349d5 commit 9d502de

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

modules/management/tenant-space/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ variable "network_namespace_name" {
126126
type = string
127127
description = "Override the name of the network namespace. Defaults to <project_name>-net. Use this when importing a brownfield namespace whose name differs from the default."
128128
default = null
129+
validation {
130+
condition = var.network_namespace_name == null ? true : trimspace(var.network_namespace_name) != ""
131+
error_message = "network_namespace_name must be null or a non-empty string."
132+
}
129133
}
130134

131135
variable "vlan_network_names" {

0 commit comments

Comments
 (0)