From d02bdd469b012a4d4a891ec29cc17131658e2924 Mon Sep 17 00:00:00 2001 From: Jazel Canseco Date: Fri, 21 Feb 2020 15:32:26 -0800 Subject: [PATCH] google_dataflow_job - Fix bug where the wrong error variable was being checked during deletion --- google/resource_dataflow_job.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/google/resource_dataflow_job.go b/google/resource_dataflow_job.go index 976bba34b85..0ed3e5cb082 100644 --- a/google/resource_dataflow_job.go +++ b/google/resource_dataflow_job.go @@ -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") {