Skip to content

Commit

Permalink
custom image: use custom create timeout. (#985)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething committed May 1, 2023
1 parent f527346 commit 81893b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion digitalocean/image/resource_custom_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ func ResourceDigitalOceanCustomImage() *schema.Resource {
Computed: true,
},
},

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(60 * time.Minute),
},

// Images can not currently be removed from a region.
CustomizeDiff: customdiff.ForceNewIfChange("regions", func(ctx context.Context, old, new, meta interface{}) bool {
remove, _ := util.GetSetChanges(old.(*schema.Set), new.(*schema.Set))
Expand Down Expand Up @@ -256,7 +261,7 @@ func waitForImage(ctx context.Context, d *schema.ResourceData, target string, pe
Pending: pending,
Target: []string{target},
Refresh: imageStateRefreshFunc(ctx, d, attribute, meta),
Timeout: 120 * time.Minute,
Timeout: d.Timeout(schema.TimeoutCreate),
Delay: 1 * time.Second,
MinTimeout: 60 * time.Second,
}
Expand Down

0 comments on commit 81893b0

Please sign in to comment.