Skip to content

Commit

Permalink
SDK - add timeout from CustomiseDiff func to context (#24485)
Browse files Browse the repository at this point in the history
`SDK` - add timeout from `CustomiseDiff` func to context
  • Loading branch information
jackofallops authored Jan 15, 2024
2 parents d3e1ad7 + f6175c4 commit f32f73c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/sdk/wrapper_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ func (rw *ResourceWrapper) Resource() (*schema.Resource, error) {
if v, ok := rw.resource.(ResourceWithCustomizeDiff); ok {
resource.CustomizeDiff = func(ctx context.Context, d *schema.ResourceDiff, meta interface{}) error {
client := meta.(*clients.Client)
ctx, cancel := context.WithTimeout(ctx, v.CustomizeDiff().Timeout)
defer cancel()
metaData := ResourceMetaData{
Client: client,
Logger: rw.logger,
Expand Down

0 comments on commit f32f73c

Please sign in to comment.