Skip to content

Commit abb1a45

Browse files
committed
address review comments
1 parent 8f7680d commit abb1a45

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

google/cloud/storage/examples/storage_bucket_encryption_enforcement_samples.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ void UpdateBucketEncryptionEnforcementConfig(
142142
[](gcs::Client client, std::string const& bucket_name) {
143143
StatusOr<gcs::BucketMetadata> original =
144144
client.GetBucketMetadata(bucket_name);
145+
if (!original) throw std::move(original).status();
145146

146147
gcs::BucketMetadata updated_metadata = *original;
147148
gcs::BucketEncryption encryption;
@@ -155,8 +156,6 @@ void UpdateBucketEncryptionEnforcementConfig(
155156
// 2. Remove a specific type (e.g., remove CMEK enforcement)
156157
encryption.customer_managed_encryption_enforcement_config.restriction_mode =
157158
"NotRestricted";
158-
// For the update, need to specify all three configs, so keeping this same
159-
// as before
160159
encryption.customer_supplied_encryption_enforcement_config
161160
.restriction_mode = "FullyRestricted";
162161

0 commit comments

Comments
 (0)