Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create simultaneously edgegateway failure #994

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/993.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
`resource/cloudavenue_edgegateway` - Fix the problem that prevents the creation of several edge gateways simultaneously.
```
6 changes: 3 additions & 3 deletions internal/provider/edgegw/edgegateway_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,16 @@ func (r *edgeGatewayResource) Create(ctx context.Context, req resource.CreateReq
ctx, cancel = context.WithTimeout(ctx, createTimeout)
defer cancel()

cloudavenue.Lock(ctx)
defer cloudavenue.Unlock(ctx)

// List all edge gateways for determining the ID of the new edge gateway
edgegws, err := r.client.CAVSDK.V1.EdgeGateway.List()
if err != nil {
resp.Diagnostics.AddError("Error listing edge gateways", err.Error())
return
}

cloudavenue.Lock(ctx)
defer cloudavenue.Unlock(ctx)

var job *commoncloudavenue.JobStatus

vdcOrVDCGroup, err := r.client.CAVSDK.V1.VDC().GetVDCOrVDCGroup(plan.OwnerName.Get())
Expand Down
Loading