From 2cf64b88c35991db19f83a1fa69ed41cbceebd32 Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:21:41 -0400 Subject: [PATCH] fix(vm): ensure startup / shutdown delay is applied when order is not configured (#479) --- proxmoxtf/resource/vm.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/proxmoxtf/resource/vm.go b/proxmoxtf/resource/vm.go index 41ce0c78..b8a0e2bd 100644 --- a/proxmoxtf/resource/vm.go +++ b/proxmoxtf/resource/vm.go @@ -1303,18 +1303,16 @@ func VM() *schema.Resource { Default: dvResourceVirtualEnvironmentVMStartupOrder, }, mkResourceVirtualEnvironmentVMStartupUpDelay: { - Type: schema.TypeInt, - Description: "A non-negative number defining the delay in seconds before the next VM is started", - Optional: true, - Default: dvResourceVirtualEnvironmentVMStartupUpDelay, - ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(0)), + Type: schema.TypeInt, + Description: "A non-negative number defining the delay in seconds before the next VM is started", + Optional: true, + Default: dvResourceVirtualEnvironmentVMStartupUpDelay, }, mkResourceVirtualEnvironmentVMStartupDownDelay: { - Type: schema.TypeInt, - Description: "A non-negative number defining the delay in seconds before the next VM is shut down", - Optional: true, - Default: dvResourceVirtualEnvironmentVMStartupDownDelay, - ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(0)), + Type: schema.TypeInt, + Description: "A non-negative number defining the delay in seconds before the next VM is shut down", + Optional: true, + Default: dvResourceVirtualEnvironmentVMStartupDownDelay, }, }, }, @@ -3206,8 +3204,9 @@ func vmGetStartupOrder(d *schema.ResourceData) *vms.CustomStartupOrder { if startupOrder >= 0 { order.Order = &startupOrder - return &order } + + return &order } return nil