Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
16 changes: 14 additions & 2 deletions internal/common/autogen/handle_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type WaitReq struct {
StateProperty string
PendingStates []string
TargetStates []string
TimeoutSeconds int
Timeout time.Duration
MinTimeoutSeconds int
DelaySeconds int
}
Expand All @@ -49,6 +49,9 @@ type HandleCreateReq struct {

func HandleCreate(ctx context.Context, req HandleCreateReq) {
d := &req.Resp.Diagnostics
if d.HasError() {
return
}
bodyReq, err := Marshal(req.Plan, false)
if err != nil {
addError(d, opCreate, errBuildingAPIRequest, err)
Expand Down Expand Up @@ -85,6 +88,9 @@ type HandleReadReq struct {

func HandleRead(ctx context.Context, req HandleReadReq) {
d := &req.Resp.Diagnostics
if d.HasError() {
return
}
bodyResp, apiResp, err := callAPIWithoutBody(ctx, req.Client, req.CallParams)
if notFound(bodyResp, apiResp) {
req.Resp.State.RemoveResource(ctx)
Expand Down Expand Up @@ -117,6 +123,9 @@ type HandleUpdateReq struct {

func HandleUpdate(ctx context.Context, req HandleUpdateReq) {
d := &req.Resp.Diagnostics
if d.HasError() {
return
}
bodyReq, err := Marshal(req.Plan, true)
if err != nil {
addError(d, opUpdate, errBuildingAPIRequest, err)
Expand Down Expand Up @@ -155,6 +164,9 @@ type HandleDeleteReq struct {

func HandleDelete(ctx context.Context, req HandleDeleteReq) {
d := &req.Resp.Diagnostics
if d.HasError() {
return
}
var err error
if req.StaticRequestBody == "" {
_, _, err = callAPIWithoutBody(ctx, req.Client, req.CallParams)
Expand Down Expand Up @@ -240,7 +252,7 @@ func waitForChanges(ctx context.Context, wait *WaitReq, client *config.MongoDBCl
stateConf := retry.StateChangeConf{
Target: wait.TargetStates,
Pending: wait.PendingStates,
Timeout: time.Duration(wait.TimeoutSeconds) * time.Second,
Timeout: wait.Timeout,
MinTimeout: time.Duration(wait.MinTimeoutSeconds) * time.Second,
Delay: time.Duration(wait.DelaySeconds) * time.Second,
Refresh: refreshFunc(ctx, wait, client),
Expand Down
12 changes: 0 additions & 12 deletions internal/serviceapi/auditingapi/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 10 additions & 15 deletions internal/serviceapi/clusterapi/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions internal/serviceapi/customdbroleapi/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions internal/serviceapi/databaseuserapi/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions internal/serviceapi/maintenancewindowapi/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions internal/serviceapi/orgserviceaccountapi/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions internal/serviceapi/projectapi/resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading