Skip to content

Commit 8cc71c1

Browse files
committed
Update bucket attributes in order to disable soft delete
1 parent ca28d2f commit 8cc71c1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cli_tools/common/utils/storage/scratch_bucket_creator.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,15 @@ func (c *ScratchBucketCreator) getBucketAttrs(fileGcsPath string, project string
7777
// if file is not provided, fallback to input / default zone.
7878
bucketAttrs, err = c.getBucketAttrsOnFallbackZone(project, fallbackZone)
7979
}
80-
81-
if err == nil {
82-
// Enable Uniform-Bucket-Level-Access by default in image-import/export tools.
83-
bucketAttrs.UniformBucketLevelAccess.Enabled = enableUniformBucketLevelAccess
84-
// Disable soft delete.
85-
bucketAttrs.SoftDeletePolicy = &storage.SoftDeletePolicy{RetentionDuration: 0}
80+
if err != nil {
81+
return nil, err
8682
}
8783

84+
// Enable Uniform-Bucket-Level-Access by default in image-import/export tools.
85+
bucketAttrs.UniformBucketLevelAccess.Enabled = enableUniformBucketLevelAccess
86+
// Disable soft delete.
87+
bucketAttrs.SoftDeletePolicy = &storage.SoftDeletePolicy{RetentionDuration: 0}
88+
8889
return bucketAttrs, err
8990
}
9091

0 commit comments

Comments
 (0)