Update services dependencies (#64)

* Update services dependencies

* Move reference

---------

Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
Henrique Santos 2023-10-04 15:18:23 +01:00 committed by GitHub
parent 70e269a357
commit 7354808f02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 155 additions and 121 deletions

View file

@ -11,6 +11,7 @@ import (
"github.com/stackitcloud/stackit-sdk-go/core/config"
"github.com/stackitcloud/stackit-sdk-go/core/utils"
"github.com/stackitcloud/stackit-sdk-go/services/postgresql"
"github.com/stackitcloud/stackit-sdk-go/services/postgresql/wait"
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/testutil"
)
@ -228,7 +229,7 @@ func testAccCheckPostgreSQLDestroy(s *terraform.State) error {
if err != nil {
return fmt.Errorf("destroying instance %s during CheckDestroy: %w", *instances[i].InstanceId, err)
}
_, err = postgresql.DeleteInstanceWaitHandler(ctx, client, testutil.ProjectId, *instances[i].InstanceId).WaitWithContext(ctx)
_, err = wait.DeleteInstanceWaitHandler(ctx, client, testutil.ProjectId, *instances[i].InstanceId).WaitWithContext(ctx)
if err != nil {
return fmt.Errorf("destroying instance %s during CheckDestroy: waiting for deletion %w", *instances[i].InstanceId, err)
}
@ -239,12 +240,12 @@ func testAccCheckPostgreSQLDestroy(s *terraform.State) error {
}
func checkInstanceDeleteSuccess(i *postgresql.Instance) bool {
if *i.LastOperation.Type != postgresql.InstanceTypeDelete {
if *i.LastOperation.Type != wait.InstanceTypeDelete {
return false
}
if *i.LastOperation.Type == postgresql.InstanceTypeDelete {
if *i.LastOperation.State != postgresql.InstanceStateSuccess {
if *i.LastOperation.Type == wait.InstanceTypeDelete {
if *i.LastOperation.State != wait.InstanceStateSuccess {
return false
} else if strings.Contains(*i.LastOperation.Description, "DeleteFailed") || strings.Contains(*i.LastOperation.Description, "failed") {
return false