From e51e787c3a792176a6401c2db1b15cb2a30449e0 Mon Sep 17 00:00:00 2001 From: Vilhelm Prytz Date: Mon, 25 Dec 2023 19:08:53 +0100 Subject: [PATCH] resource_vm_qemu: allow . (dot) in name of virtual machine (#886) fixes #885 --- proxmox/resource_vm_qemu.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox/resource_vm_qemu.go b/proxmox/resource_vm_qemu.go index 93ff526c..f41fc089 100755 --- a/proxmox/resource_vm_qemu.go +++ b/proxmox/resource_vm_qemu.go @@ -75,12 +75,12 @@ func resourceVmQemu() *schema.Resource { Description: "The VM name", ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { v := val.(string) - matched, err := regexp.Match("[^a-zA-Z0-9-]", []byte(v)) + matched, err := regexp.Match("[^a-zA-Z0-9-.]", []byte(v)) if err != nil { warns = append(warns, fmt.Sprintf("%q, had an error running regexp.Match err=[%v]", key, err)) } if matched { - errs = append(errs, fmt.Errorf("%q, must be contain only alphanumerics and hyphens [%v]", key, v)) + errs = append(errs, fmt.Errorf("%q, must only contain alphanumerics, hyphens and dots [%v]", key, v)) } return },