Skip to content

Commit ca10412

Browse files
modular-magicianslevenick
authored andcommitted
Remove extra permission required for doing a destory in resource_storage_bucket (#13730)
[upstream:69064da3e03584ab510448426a2973d2a951d3cd] Signed-off-by: Modular Magician <[email protected]>
1 parent 8bd8713 commit ca10412

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

google-beta/services/storage/resource_storage_bucket.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,9 @@ func resourceStorageBucketDelete(d *schema.ResourceData, meta interface{}) error
10881088

10891089
cacheList, cacheListErr := getAnywhereCacheListResult(config, bucket)
10901090
if cacheListErr != nil {
1091-
return cacheListErr
1091+
// If we get any error, try deleting the bucket anyway in case it's empty
1092+
// This would help our customers to avoid requiring extra storage.anywhereCaches.list permission.
1093+
break
10921094
}
10931095

10941096
if len(res.Items) == 0 && len(cacheList) == 0 {

0 commit comments

Comments
 (0)