Skip to content

Commit

Permalink
fix: race condition on updating integration config data
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyuan committed May 6, 2024
1 parent 99dacb4 commit f047789
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions internal/provider/resource_integration_opsgenie.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,6 @@ func (r *IntegrationOpsgenie) Create(ctx context.Context, req resource.CreateReq
return
}

if len(configData.TeamTable) != len(idsSeen)+1 {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Service table length mismatch: %d != %d", len(configData.TeamTable), len(idsSeen)+1))
return
}

var found *IntegrationOpsgenieConfigDataTeamTableItem
for _, item := range configData.TeamTable {
if _, ok := idsSeen[item.Id]; !ok {
Expand Down
5 changes: 0 additions & 5 deletions internal/provider/resource_integration_pagerduty.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,6 @@ func (r *IntegrationPagerDuty) Create(ctx context.Context, req resource.CreateRe
return
}

if len(configData.ServiceTable) != len(idsSeen)+1 {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Service table length mismatch: %d != %d", len(configData.ServiceTable), len(idsSeen)+1))
return
}

var found *IntegrationPagerDutyConfigDataServiceTableItem
for _, item := range configData.ServiceTable {
if _, ok := idsSeen[item.Id]; !ok {
Expand Down

0 comments on commit f047789

Please sign in to comment.