From 8359c03aa8069d8816e0802e41fb36a220040673 Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Wed, 10 May 2023 22:06:15 -0400 Subject: [PATCH] fix(vm,lxc): Add validation for non-empty tags (#330) --- proxmoxtf/resource/container.go | 11 +++++++---- proxmoxtf/resource/vm.go | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/proxmoxtf/resource/container.go b/proxmoxtf/resource/container.go index 38467201..8ae4138c 100644 --- a/proxmoxtf/resource/container.go +++ b/proxmoxtf/resource/container.go @@ -605,10 +605,13 @@ func Container() *schema.Resource { }, }, mkResourceVirtualEnvironmentContainerTags: { - Type: schema.TypeList, - Description: "Tags of the container. This is only meta information.", - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + Description: "Tags of the container. This is only meta information.", + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringIsNotEmpty, + }, DiffSuppressFunc: suppressIfListsAreEqualIgnoringOrder, DiffSuppressOnRefresh: true, }, diff --git a/proxmoxtf/resource/vm.go b/proxmoxtf/resource/vm.go index 6da17b15..b7f7a4da 100644 --- a/proxmoxtf/resource/vm.go +++ b/proxmoxtf/resource/vm.go @@ -1117,10 +1117,13 @@ func VM() *schema.Resource { Default: dvResourceVirtualEnvironmentVMTabletDevice, }, mkResourceVirtualEnvironmentVMTags: { - Type: schema.TypeList, - Description: "Tags of the virtual machine. This is only meta information.", - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Type: schema.TypeList, + Description: "Tags of the virtual machine. This is only meta information.", + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringIsNotEmpty, + }, DiffSuppressFunc: suppressIfListsAreEqualIgnoringOrder, DiffSuppressOnRefresh: true, },