From d096e131750a5f1c2b4357165f8a7de221d5ce6f Mon Sep 17 00:00:00 2001 From: Jan Obernberger Date: Mon, 18 May 2026 09:51:47 +0200 Subject: [PATCH 1/9] feat(mongodbflex): refactored and tested mongodbflex wait handler to use wait helper. --- services/mongodbflex/v2api/wait/wait.go | 114 +++++++++++------------- 1 file changed, 54 insertions(+), 60 deletions(-) diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index 036c44bd8..ea1f760f7 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -2,12 +2,11 @@ package wait import ( "context" + "errors" "fmt" - "net/http" "sort" "time" - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" "github.com/stackitcloud/stackit-sdk-go/core/wait" mongodbflex "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex/v2api" ) @@ -37,29 +36,15 @@ const ( // CreateInstanceWaitHandler will wait for instance creation func CreateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { - handler := wait.New(func() (waitFinished bool, response *mongodbflex.InstanceResponse, err error) { - s, err := a.GetInstance(ctx, projectId, instanceId, region).Execute() - if err != nil { - return false, nil, err - } - if s == nil || s.Item == nil || s.Item.Id == nil || *s.Item.Id != instanceId || s.Item.Status == nil { - return false, nil, nil - } - switch *s.Item.Status { - default: - return true, s, fmt.Errorf("instance with id %s has unexpected status %s", instanceId, *s.Item.Status) - case "": - return false, nil, nil - case mongodbflex.INSTANCESTATUS_PROCESSING: - return false, nil, nil - case mongodbflex.INSTANCESTATUS_UNKNOWN: - return false, nil, nil - case mongodbflex.INSTANCESTATUS_READY: - return true, s, nil - case mongodbflex.INSTANCESTATUS_FAILED: - return true, s, fmt.Errorf("create failed for instance with id %s", instanceId) - } - }) + waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, string]{ + FetchInstance: a.GetInstance(ctx, projectId, region, instanceId).Execute, + GetState: getStateInstance, + ActiveState: []string{INSTANCESTATUS_READY}, + ErrorState: []string{INSTANCESTATUS_FAILED}, + } + + handler := wait.New(waitConfig.Wait()) + handler.SetTimeout(45 * time.Minute) handler.SetSleepBeforeWait(5 * time.Second) return handler @@ -116,29 +101,15 @@ func RestoreInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, p // UpdateInstanceWaitHandler will wait for instance update func UpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { - handler := wait.New(func() (waitFinished bool, response *mongodbflex.InstanceResponse, err error) { - s, err := a.GetInstance(ctx, projectId, instanceId, region).Execute() - if err != nil { - return false, nil, err - } - if s == nil || s.Item == nil || s.Item.Id == nil || *s.Item.Id != instanceId || s.Item.Status == nil { - return false, nil, nil - } - switch *s.Item.Status { - default: - return true, s, fmt.Errorf("instance with id %s has unexpected status %s", instanceId, *s.Item.Status) - case "": - return false, nil, nil - case mongodbflex.INSTANCESTATUS_PROCESSING: - return false, nil, nil - case mongodbflex.INSTANCESTATUS_UNKNOWN: - return false, nil, nil - case mongodbflex.INSTANCESTATUS_READY: - return true, s, nil - case mongodbflex.INSTANCESTATUS_FAILED: - return true, s, fmt.Errorf("update failed for instance with id %s", instanceId) - } - }) + waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, string]{ + FetchInstance: a.GetInstance(ctx, projectId, region, instanceId).Execute, + GetState: getStateInstance, + ActiveState: []string{INSTANCESTATUS_READY}, + ErrorState: []string{INSTANCESTATUS_FAILED}, + } + + handler := wait.New(waitConfig.Wait()) + handler.SetTimeout(45 * time.Minute) return handler } @@ -150,20 +121,43 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.Default // DeleteInstanceWaitHandler will wait for instance deletion func DeleteInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[struct{}] { - handler := wait.New(func() (waitFinished bool, response *struct{}, err error) { - _, err = a.GetInstance(ctx, projectId, instanceId, region).Execute() - if err == nil { - return false, nil, nil - } - oapiErr, ok := err.(*oapierror.GenericOpenAPIError) //nolint:errorlint //complaining that error.As should be used to catch wrapped errors, but this error should not be wrapped - if !ok { - return false, nil, fmt.Errorf("could not convert error to oapierror.GenericOpenAPIError") + w := wait.WaiterHelper[mongodbflex.InstanceResponse, string]{ + FetchInstance: a.GetInstance(ctx, projectId, region, instanceId).Execute, + GetState: getStateInstance, + ActiveState: []string{}, + ErrorState: []string{}, + } + + // adapter for adhering to the wait helper type schema + genericCheck := w.Wait() + adaptedCheck := func() (waitFinished bool, response *struct{}, err error) { + finished, _, err := genericCheck() + if err != nil { + return finished, nil, err } - if oapiErr.StatusCode != http.StatusNotFound { - return false, nil, err + if finished { + return true, nil, nil } - return true, nil, nil - }) + return false, nil, nil + } + + handler := wait.New(adaptedCheck) handler.SetTimeout(15 * time.Minute) return handler } + +func getStateInstance(response *mongodbflex.InstanceResponse) (string, error) { + if response == nil { + return "", errors.New("empty response") + } + if response.Item == nil { + return "", errors.New("emtpy items") + } + if response.Item.Id == nil { + return "", errors.New("emtpy item id") + } + if response.Item.Status == nil { + return "", errors.New("emtpy item status") + } + return *response.Item.Status, nil +} From b184e4889c8990a249aec1a210eb8cc5ca031822 Mon Sep 17 00:00:00 2001 From: Jan Obernberger Date: Mon, 18 May 2026 10:20:57 +0200 Subject: [PATCH 2/9] feat(mongodbflex): flatted adapter function --- services/mongodbflex/v2api/wait/wait.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index ea1f760f7..d32f67c9e 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -132,13 +132,7 @@ func DeleteInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr genericCheck := w.Wait() adaptedCheck := func() (waitFinished bool, response *struct{}, err error) { finished, _, err := genericCheck() - if err != nil { - return finished, nil, err - } - if finished { - return true, nil, nil - } - return false, nil, nil + return finished, nil, err } handler := wait.New(adaptedCheck) From 069c881e6c8189f853a8800e33fc6624e9a50ffc Mon Sep 17 00:00:00 2001 From: Jan Obernberger Date: Mon, 18 May 2026 11:43:38 +0200 Subject: [PATCH 3/9] fix(mongodbflex): ordered parameters for fetch function correctly --- services/mongodbflex/v2api/wait/wait.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index d32f67c9e..b4cb99c93 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -37,7 +37,7 @@ const ( // CreateInstanceWaitHandler will wait for instance creation func CreateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, string]{ - FetchInstance: a.GetInstance(ctx, projectId, region, instanceId).Execute, + FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, ActiveState: []string{INSTANCESTATUS_READY}, ErrorState: []string{INSTANCESTATUS_FAILED}, @@ -102,7 +102,7 @@ func RestoreInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, p // UpdateInstanceWaitHandler will wait for instance update func UpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, string]{ - FetchInstance: a.GetInstance(ctx, projectId, region, instanceId).Execute, + FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, ActiveState: []string{INSTANCESTATUS_READY}, ErrorState: []string{INSTANCESTATUS_FAILED}, @@ -122,7 +122,7 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.Default // DeleteInstanceWaitHandler will wait for instance deletion func DeleteInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[struct{}] { w := wait.WaiterHelper[mongodbflex.InstanceResponse, string]{ - FetchInstance: a.GetInstance(ctx, projectId, region, instanceId).Execute, + FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, ActiveState: []string{}, ErrorState: []string{}, From 235b4cb19fecc0a855eda854ff8a972fa61a821f Mon Sep 17 00:00:00 2001 From: Jan Obernberger Date: Mon, 18 May 2026 12:26:43 +0200 Subject: [PATCH 4/9] feature(mongodbflex): adapted wait restore handler to use new wait helper --- services/mongodbflex/v2api/wait/wait.go | 66 +++++++++++-------------- 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index b4cb99c93..b414bf0c2 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -3,7 +3,6 @@ package wait import ( "context" "errors" - "fmt" "sort" "time" @@ -56,44 +55,35 @@ func CloneInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pro } func RestoreInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, backupId, region string) *wait.AsyncActionHandler[mongodbflex.ListRestoreJobsResponse] { - handler := wait.New(func() (waitFinished bool, response *mongodbflex.ListRestoreJobsResponse, err error) { - s, err := a.ListRestoreJobs(ctx, projectId, instanceId, region).Execute() - if err != nil { - return false, nil, err - } - if s == nil || s.Items == nil { - return false, nil, nil - } - - restoreJobsSlice := s.Items - - // sort array by descending date - sort.Slice(restoreJobsSlice, func(i, j int) bool { - // swap elements to sort by descending order - return *restoreJobsSlice[i].Date > *restoreJobsSlice[j].Date - }) - - var status string - for _, restoreJob := range restoreJobsSlice { - if *restoreJob.BackupID == backupId { - status = *restoreJob.Status - break + waitConfig := wait.WaiterHelper[mongodbflex.ListRestoreJobsResponse, string]{ + FetchInstance: a.ListRestoreJobs(ctx, projectId, instanceId, region).Execute, + GetState: func(response *mongodbflex.ListRestoreJobsResponse) (string, error) { + if response == nil { + return "", errors.New("response is nil") } - } - - switch status { - default: - return true, s, fmt.Errorf("restore job for backup with id %s has unexpected status %s", backupId, status) - case RestoreJobProcessing: - return false, nil, nil - case RestoreJobFinished: - return true, s, nil - case RestoreJobBroken: - return true, s, fmt.Errorf("restore job for backup with id %s is broken", backupId) - case RestoreJobKilled: - return true, s, fmt.Errorf("restore job for backup with id %s was killed", backupId) - } - }) + if len(response.Items) == 0 { + return "", errors.New("response items is empty") + } + restoreJobsSlice := response.Items + // sort array by descending date + sort.Slice(restoreJobsSlice, func(i, j int) bool { + // swap elements to sort by descending order + return *restoreJobsSlice[i].Date > *restoreJobsSlice[j].Date + }) + + var status string + for _, restoreJob := range restoreJobsSlice { + if *restoreJob.BackupID == backupId { + status = *restoreJob.Status + break + } + } + return status, nil + }, + } + + handler := wait.New(waitConfig.Wait()) + handler.SetTimeout(45 * time.Minute) handler.SetSleepBeforeWait(5 * time.Second) return handler From 8474b3ff0e64254d12cfbc99f77edd6a5802b08a Mon Sep 17 00:00:00 2001 From: Jan Obernberger Date: Mon, 18 May 2026 13:39:47 +0200 Subject: [PATCH 5/9] feature(mongodbflex): added missing states in RestoreInstanceWaitHandler --- services/mongodbflex/v2api/wait/wait.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index b414bf0c2..6cea56f87 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -80,6 +80,8 @@ func RestoreInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, p } return status, nil }, + ActiveState: []string{RestoreJobFinished}, + ErrorState: []string{RestoreJobKilled, RestoreJobBroken}, } handler := wait.New(waitConfig.Wait()) From 9557468ba1a1ef11ca345820629e1e595d53f7e7 Mon Sep 17 00:00:00 2001 From: Jan Obernberger Date: Mon, 18 May 2026 13:49:12 +0200 Subject: [PATCH 6/9] fix(mongodbflex): fixed linter issues and wrote CHANGELOG.md --- CHANGELOG.md | 2 ++ services/mongodbflex/CHANGELOG.md | 3 +++ services/mongodbflex/VERSION | 2 +- services/mongodbflex/v2api/wait/wait.go | 6 +++--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 023da9975..3dc8d14d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -288,6 +288,8 @@ - **Dependencies:** Bump STACKIT SDK core module from `v0.25.0` to `v0.26.0` - [v1.9.0](services/mongodbflex/CHANGELOG.md#v190) - **Feature:** Introduce enums for various attributes + - [v1.10.0](services/mongodbflex/CHANGELOG.md#v183) + - **Improvement:** Use new WaiterHelper for mongodbflex - `objectstorage`: - [v1.7.2](services/objectstorage/CHANGELOG.md#v172) - **Dependencies:** Bump STACKIT SDK core module from `v0.24.0` to `v0.24.1` diff --git a/services/mongodbflex/CHANGELOG.md b/services/mongodbflex/CHANGELOG.md index 057fcad09..875e1e1df 100644 --- a/services/mongodbflex/CHANGELOG.md +++ b/services/mongodbflex/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.10.0 +- **Improvement:** Use new WaiterHelper for mongodbflex + ## v1.9.0 - **Feature:** Introduce enums for various attributes diff --git a/services/mongodbflex/VERSION b/services/mongodbflex/VERSION index 295e37c0e..e1e35526c 100644 --- a/services/mongodbflex/VERSION +++ b/services/mongodbflex/VERSION @@ -1 +1 @@ -v1.9.0 +v1.10.0 \ No newline at end of file diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index 6cea56f87..b59a4751a 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -137,13 +137,13 @@ func getStateInstance(response *mongodbflex.InstanceResponse) (string, error) { return "", errors.New("empty response") } if response.Item == nil { - return "", errors.New("emtpy items") + return "", errors.New("empty items") } if response.Item.Id == nil { - return "", errors.New("emtpy item id") + return "", errors.New("empty item id") } if response.Item.Status == nil { - return "", errors.New("emtpy item status") + return "", errors.New("empty item status") } return *response.Item.Status, nil } From 441632d5a4f5b93fed334d2308a259441b1b2375 Mon Sep 17 00:00:00 2001 From: Jan Obernberger Date: Wed, 20 May 2026 14:04:02 +0200 Subject: [PATCH 7/9] feat(mongodbflex): fixed missing error states --- services/mongodbflex/v2api/wait/wait.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index b59a4751a..307d3ee19 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -117,7 +117,7 @@ func DeleteInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, ActiveState: []string{}, - ErrorState: []string{}, + ErrorState: []string{INSTANCESTATUS_FAILED}, } // adapter for adhering to the wait helper type schema From 33d47905e295fd048d7f196e897df2906fc6ceea Mon Sep 17 00:00:00 2001 From: Jan Obernberger Date: Mon, 1 Jun 2026 11:24:29 +0200 Subject: [PATCH 8/9] feat(mongodbflex): adapted types to align to new enums concept --- services/mongodbflex/v2api/wait/wait.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index 307d3ee19..c85fbdc8a 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -35,11 +35,11 @@ const ( // CreateInstanceWaitHandler will wait for instance creation func CreateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { - waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, string]{ + waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, mongodbflex.InstanceStatus]{ FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, - ActiveState: []string{INSTANCESTATUS_READY}, - ErrorState: []string{INSTANCESTATUS_FAILED}, + ActiveState: []mongodbflex.InstanceStatus{INSTANCESTATUS_READY}, + ErrorState: []mongodbflex.InstanceStatus{INSTANCESTATUS_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -93,11 +93,11 @@ func RestoreInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, p // UpdateInstanceWaitHandler will wait for instance update func UpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[mongodbflex.InstanceResponse] { - waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, string]{ + waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, mongodbflex.InstanceStatus]{ FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, - ActiveState: []string{INSTANCESTATUS_READY}, - ErrorState: []string{INSTANCESTATUS_FAILED}, + ActiveState: []mongodbflex.InstanceStatus{INSTANCESTATUS_READY}, + ErrorState: []mongodbflex.InstanceStatus{INSTANCESTATUS_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -113,11 +113,11 @@ func PartialUpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.Default // DeleteInstanceWaitHandler will wait for instance deletion func DeleteInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, projectId, instanceId, region string) *wait.AsyncActionHandler[struct{}] { - w := wait.WaiterHelper[mongodbflex.InstanceResponse, string]{ + w := wait.WaiterHelper[mongodbflex.InstanceResponse, mongodbflex.InstanceStatus]{ FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, - ActiveState: []string{}, - ErrorState: []string{INSTANCESTATUS_FAILED}, + ActiveState: []mongodbflex.InstanceStatus{}, + ErrorState: []mongodbflex.InstanceStatus{INSTANCESTATUS_FAILED}, } // adapter for adhering to the wait helper type schema @@ -132,7 +132,7 @@ func DeleteInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr return handler } -func getStateInstance(response *mongodbflex.InstanceResponse) (string, error) { +func getStateInstance(response *mongodbflex.InstanceResponse) (mongodbflex.InstanceStatus, error) { if response == nil { return "", errors.New("empty response") } From b19d8af349a139673e6d8d4a30741181431ec6ad Mon Sep 17 00:00:00 2001 From: Jan Obernberger Date: Mon, 1 Jun 2026 11:39:32 +0200 Subject: [PATCH 9/9] feat(mongodbflex): run go:fix for enums --- services/mongodbflex/v2api/wait/wait.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/mongodbflex/v2api/wait/wait.go b/services/mongodbflex/v2api/wait/wait.go index c85fbdc8a..a9f2380e7 100644 --- a/services/mongodbflex/v2api/wait/wait.go +++ b/services/mongodbflex/v2api/wait/wait.go @@ -38,8 +38,8 @@ func CreateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, mongodbflex.InstanceStatus]{ FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, - ActiveState: []mongodbflex.InstanceStatus{INSTANCESTATUS_READY}, - ErrorState: []mongodbflex.InstanceStatus{INSTANCESTATUS_FAILED}, + ActiveState: []mongodbflex.InstanceStatus{mongodbflex.INSTANCESTATUS_READY}, + ErrorState: []mongodbflex.InstanceStatus{mongodbflex.INSTANCESTATUS_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -96,8 +96,8 @@ func UpdateInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr waitConfig := wait.WaiterHelper[mongodbflex.InstanceResponse, mongodbflex.InstanceStatus]{ FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, - ActiveState: []mongodbflex.InstanceStatus{INSTANCESTATUS_READY}, - ErrorState: []mongodbflex.InstanceStatus{INSTANCESTATUS_FAILED}, + ActiveState: []mongodbflex.InstanceStatus{mongodbflex.INSTANCESTATUS_READY}, + ErrorState: []mongodbflex.InstanceStatus{mongodbflex.INSTANCESTATUS_FAILED}, } handler := wait.New(waitConfig.Wait()) @@ -117,7 +117,7 @@ func DeleteInstanceWaitHandler(ctx context.Context, a mongodbflex.DefaultAPI, pr FetchInstance: a.GetInstance(ctx, projectId, instanceId, region).Execute, GetState: getStateInstance, ActiveState: []mongodbflex.InstanceStatus{}, - ErrorState: []mongodbflex.InstanceStatus{INSTANCESTATUS_FAILED}, + ErrorState: []mongodbflex.InstanceStatus{mongodbflex.INSTANCESTATUS_FAILED}, } // adapter for adhering to the wait helper type schema