Skip to content

Commit

Permalink
fix(vm): ensure startup / shutdown delay is applied when order is not…
Browse files Browse the repository at this point in the history
… configured (#479)
  • Loading branch information
bpg authored Aug 10, 2023
1 parent 8d0b3ed commit 2cf64b8
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions proxmoxtf/resource/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
Expand Down Expand Up @@ -3206,8 +3204,9 @@ func vmGetStartupOrder(d *schema.ResourceData) *vms.CustomStartupOrder {

if startupOrder >= 0 {
order.Order = &startupOrder
return &order
}

return &order
}

return nil
Expand Down

0 comments on commit 2cf64b8

Please sign in to comment.