From d1f2093d3977ff9d30b1af95f97e1fe601d22991 Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:37:36 -0500 Subject: [PATCH] fix(lxc): description is always showed as changed (#762) Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --- proxmoxtf/resource/container.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxmoxtf/resource/container.go b/proxmoxtf/resource/container.go index 8f051174..2bce3512 100644 --- a/proxmoxtf/resource/container.go +++ b/proxmoxtf/resource/container.go @@ -270,6 +270,11 @@ func Container() *schema.Resource { Description: "The description", Optional: true, Default: dvResourceVirtualEnvironmentContainerDescription, + StateFunc: func(i interface{}) string { + // PVE always adds a newline to the description, so we have to do the same, + // also taking in account the CLRF case (Windows) + return strings.ReplaceAll(strings.TrimSpace(i.(string)), "\r\n", "\n") + "\n" + }, }, mkResourceVirtualEnvironmentContainerDisk: { Type: schema.TypeList,