Skip to content

Commit

Permalink
refactor: move spot market timeouts out of provider.go (#483)
Browse files Browse the repository at this point in the history
There was a private variable for default timeouts defined in
`provider.go`, but it was only referenced in the spot market request
data source. Other resources and data sources define their default
timeouts inline; this does the same for the spot market request data
source so that it will be easier to move that data source to a different
package than the one that `provider.go` is in.
  • Loading branch information
ctreatma authored Dec 12, 2023
1 parent 3f63566 commit 2855e91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 6 additions & 1 deletion equinix/data_source_metal_spot_market_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ func dataSourceMetalSpotMarketRequest() *schema.Resource {
Computed: true,
},
},
Timeouts: resourceDefaultTimeouts,
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(60 * time.Minute),
Update: schema.DefaultTimeout(60 * time.Minute),
Delete: schema.DefaultTimeout(60 * time.Minute),
Default: schema.DefaultTimeout(60 * time.Minute),
},
}
}

Expand Down
7 changes: 0 additions & 7 deletions equinix/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,6 @@ func configureProvider(ctx context.Context, d *schema.ResourceData, p *schema.Pr
return &config, nil
}

var resourceDefaultTimeouts = &schema.ResourceTimeout{
Create: schema.DefaultTimeout(60 * time.Minute),
Update: schema.DefaultTimeout(60 * time.Minute),
Delete: schema.DefaultTimeout(60 * time.Minute),
Default: schema.DefaultTimeout(60 * time.Minute),
}

func expandListToStringList(list []interface{}) []string {
result := make([]string, len(list))
for i, v := range list {
Expand Down

0 comments on commit 2855e91

Please sign in to comment.