Skip to content

Commit

Permalink
Merge pull request #44 from rackn/machine-timeout
Browse files Browse the repository at this point in the history
Add support for timeouts on the machine resource.
  • Loading branch information
galthaus authored Jun 13, 2018
2 parents 01f6986 + e8184d3 commit b8dc0cd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drp/resource_drp_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ func resourceMachine() *schema.Resource {
r.Update = resourceMachineUpdate
r.Delete = resourceMachineDelete

r.Timeouts = &schema.ResourceTimeout{
Create: schema.DefaultTimeout(25 * time.Minute),
Update: schema.DefaultTimeout(10 * time.Minute),
Delete: schema.DefaultTimeout(10 * time.Minute),
}

// Define what the machines completion stage.
r.Schema["completion_stage"] = &schema.Schema{
Type: schema.TypeString,
Expand Down Expand Up @@ -325,7 +331,7 @@ func resourceMachineCreate(d *schema.ResourceData, meta interface{}) error {
Pending: []string{"9:"},
Target: []string{"6:"},
Refresh: getMachineStatus(cc, machineObj.UUID(), stages),
Timeout: 25 * time.Minute,
Timeout: d.Timeout(schema.TimeoutCreate),
Delay: 10 * time.Second,
MinTimeout: 3 * time.Second,
}
Expand Down

0 comments on commit b8dc0cd

Please sign in to comment.