From bf98b941f7bdfea2d4c19239d04d4b57c19f9da6 Mon Sep 17 00:00:00 2001 From: Grant Gongaware Date: Thu, 7 Mar 2019 08:04:45 -0800 Subject: [PATCH] change "macaddr" to behave like original "mac" --- proxmox/resource_vm_qemu.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proxmox/resource_vm_qemu.go b/proxmox/resource_vm_qemu.go index 978f1b1..cbdf41a 100644 --- a/proxmox/resource_vm_qemu.go +++ b/proxmox/resource_vm_qemu.go @@ -91,7 +91,13 @@ func resourceVmQemu() *schema.Resource { "macaddr": &schema.Schema{ // TODO: Find a way to set MAC address in .tf config. Type: schema.TypeString, - Computed: true, + Optional: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + if new == "" { + return true // macaddr auto-generates and its ok + } + return strings.TrimSpace(old) == strings.TrimSpace(new) + }, }, "bridge": &schema.Schema{ Type: schema.TypeString,