mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-03 01:01:06 +00:00
Fix Google Cloud Service Account provider .Read (#14282)
The implementation would return an error if the resource was detected as removed - this would break Terraform instead of making it re-create the missing service account.
This commit is contained in:
parent
fe4873c1e1
commit
99ab5cc6c4
@ -118,11 +118,10 @@ func resourceGoogleServiceAccountRead(d *schema.ResourceData, meta interface{})
|
||||
if err != nil {
|
||||
if gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 404 {
|
||||
log.Printf("[WARN] Removing reference to service account %q because it no longer exists", d.Id())
|
||||
saName := d.Id()
|
||||
// The resource doesn't exist anymore
|
||||
d.SetId("")
|
||||
|
||||
return fmt.Errorf("Error getting service account with name %q: %s", saName, err)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("Error reading service account %q: %q", d.Id(), err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user