Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google_dataflow_job - Fix bug where the wrong error variable was bein… #5739

Merged
merged 1 commit into from
Mar 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions google/resource_dataflow_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,17 @@ func resourceDataflowJobDelete(d *schema.ResourceData, meta interface{}) error {

_, updateErr := resourceDataflowJobUpdateJob(config, project, region, id, job)
if updateErr != nil {
gerr, isGoogleErr := err.(*googleapi.Error)
gerr, isGoogleErr := updateErr.(*googleapi.Error)
if !isGoogleErr {
// If we have an error and it's not a google-specific error, we should go ahead and return.
return resource.NonRetryableError(err)
return resource.NonRetryableError(updateErr)
}

if strings.Contains(gerr.Message, "not yet ready for canceling") {
// Retry cancelling job if it's not ready.
// Sleep to avoid hitting update quota with repeated attempts.
time.Sleep(5 * time.Second)
return resource.RetryableError(err)
return resource.RetryableError(updateErr)
}

if strings.Contains(gerr.Message, "Job has terminated") {
Expand Down