Skip to content

Commit

Permalink
fix(flink): poll application deployment status on create
Browse files Browse the repository at this point in the history
  • Loading branch information
byashimov committed Feb 19, 2024
1 parent 1bb4a14 commit b91e201
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ nav_order: 1
- Fix `aiven_organization_user_group` resource - `description` field is required
- Use golang 1.22
- Output explicitly `termination_protection = true -> false` when service property is removed
- Poll `aiven_flink_application_deployment` status on create

## [4.13.3] - 2024-01-29

Expand Down
20 changes: 0 additions & 20 deletions internal/plugin/util/wait.go

This file was deleted.

13 changes: 13 additions & 0 deletions internal/sdkprovider/service/flink/flink_application_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ func resourceFlinkApplicationDeploymentCreate(

d.SetId(schemautil.BuildResourceID(project, serviceName, applicationID, r.ID))

err = retry.RetryContext(ctx, d.Timeout(schema.TimeoutCreate), func() *retry.RetryError {
deployment, err := client.FlinkApplicationDeployments.Get(ctx, project, serviceName, applicationID, r.ID)
if err != nil {
// The client has retries under the hood for 50x and other cases.
return retry.NonRetryableError(err)
}
return &retry.RetryError{Retryable: deployment.FlinkApplicationDeployment.Status != "FINISHED"}
})

if err != nil {
return diag.Errorf("can't wait Flink Application Deployment being in FINISHED status: %v", err)
}

return resourceFlinkApplicationDeploymentRead(ctx, d, m)
}

Expand Down

0 comments on commit b91e201

Please sign in to comment.