Skip to content

Commit

Permalink
Fix panic in intergration resource update
Browse files Browse the repository at this point in the history
The 'application' field in the integration resource is not an
Attribute, but a Block, which is why when this part of the code is
hit, we get a panic with the interface conversion saying that this
doesn't look like an Attribute.
  • Loading branch information
cderici committed Oct 30, 2023
1 parent 96ec4ff commit 3894b47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/provider/resource_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func (r *integrationResource) Update(ctx context.Context, req resource.UpdateReq
}

applications := parseApplications(response.Applications)
appType := req.State.Schema.GetAttributes()["application"].(schema.SetNestedAttribute).NestedObject.Type()
appType := req.State.Schema.GetBlocks()["application"].(schema.SetNestedBlock).NestedObject.Type()
apps, aErr := types.SetValueFrom(ctx, appType, applications)
if aErr.HasError() {
resp.Diagnostics.Append(aErr...)
Expand Down

0 comments on commit 3894b47

Please sign in to comment.