Update dependencies (#112)
* Update dependencies * Remove set timeout * Remove set sleep before wait * Update to new signature, remove unnecessary calls --------- Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
parent
70cb3d1519
commit
8f5850cdf1
28 changed files with 144 additions and 344 deletions
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/path"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource"
|
||||
|
|
@ -126,16 +125,12 @@ func (r *projectResource) Create(ctx context.Context, req resource.CreateRequest
|
|||
}
|
||||
|
||||
model.Id = types.StringValue(projectId)
|
||||
wr, err := wait.CreateProjectWaitHandler(ctx, r.client, projectId).SetTimeout(5 * time.Minute).WaitWithContext(ctx)
|
||||
_, err = wait.CreateProjectWaitHandler(ctx, r.client, projectId).WaitWithContext(ctx)
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error creating cluster", fmt.Sprintf("Project creation waiting: %v", err))
|
||||
return
|
||||
}
|
||||
_, ok := wr.(*ske.ProjectResponse)
|
||||
if !ok {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error creating cluster", fmt.Sprintf("Wait result conversion, got %+v", wr))
|
||||
return
|
||||
}
|
||||
|
||||
diags := resp.State.Set(ctx, model)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
|
|
@ -190,7 +185,7 @@ func (r *projectResource) Delete(ctx context.Context, req resource.DeleteRequest
|
|||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting credential", fmt.Sprintf("Calling API: %v", err))
|
||||
return
|
||||
}
|
||||
_, err = wait.DeleteProjectWaitHandler(ctx, r.client, projectId).SetTimeout(10 * time.Minute).WaitWithContext(ctx)
|
||||
_, err = wait.DeleteProjectWaitHandler(ctx, r.client, projectId).WaitWithContext(ctx)
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error deleting credential", fmt.Sprintf("Project deletion waiting: %v", err))
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue