0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-29 18:21:10 +00:00

fix(network): adjust Linux Bridge name validator (#1961)

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2025-05-12 22:26:53 -04:00 committed by GitHub
parent a74a358b6d
commit 2a7a2ff493
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -50,7 +50,7 @@ resource "proxmox_virtual_environment_network_linux_vlan" "vlan99" {
### Required
- `name` (String) The interface name. Must be `vmbrN`, where N is a number between 0 and 9999.
- `name` (String) The interface name. Commonly vmbr[N], where 0 ≤ N ≤ 4094 (vmbr0 - vmbr4094), but can be any alphanumeric string that starts with a character and is at most 10 characters long.
- `node_name` (String) The name of the node.
### Optional

View File

@ -180,13 +180,14 @@ func (r *linuxBridgeResource) Schema(
Required: true,
},
"name": schema.StringAttribute{
Description: "The interface name.",
MarkdownDescription: "The interface name. Must be `vmbrN`, where N is a number between 0 and 9999.",
Required: true,
Description: "The interface name.",
MarkdownDescription: "The interface name. Commonly vmbr[N], where 0 ≤ N ≤ 4094 (vmbr0 - vmbr4094), but " +
"can be any alphanumeric string that starts with a character and is at most 10 characters long.",
Required: true,
Validators: []validator.String{
stringvalidator.RegexMatches(
regexp.MustCompile(`^vmbr(\d{1,4})$`),
`must be "vmbrN", where N is a number between 0 and 9999`,
regexp.MustCompile(`^[A-Za-z][A-Za-z0-9]{0,9}$`),
`must be an alphanumeric string that starts with a character and is at most 10 characters long`,
),
},
PlanModifiers: []planmodifier.String{