Skip to content

Commit

Permalink
Rework deployment logic
Browse files Browse the repository at this point in the history
This commit modifies the logic used by the `digitalocean_app` resource to check each step for a success
status rather than using the counts of steps. The step counting method fails to work with jobs of kind
`FAILED_DEPLOY` as these will always be pending, meaning that any app deployed with a job of this type
will always time out even when it is successful.

Closes #1047

Signed-off-by: David Bond <[email protected]>
  • Loading branch information
davidsbond committed Oct 11, 2023
1 parent b8ba602 commit ce3078b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion digitalocean/app/resource_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,14 @@ func waitForAppDeployment(client *godo.Client, id string, timeout time.Duration)
return fmt.Errorf("Error trying to read app deployment state: %s", err)
}

allSuccessful := deployment.Progress.SuccessSteps == deployment.Progress.TotalSteps
allSuccessful := true
for _, step := range deployment.Progress.Steps {
if step.Status != godo.DeploymentProgressStepStatus_Success {
allSuccessful = false
break
}
}

if allSuccessful {
ticker.Stop()
return nil
Expand Down

0 comments on commit ce3078b

Please sign in to comment.