Skip to content

Commit 123fc27

Browse files
committed
fix ci failures
1 parent 4eade20 commit 123fc27

File tree

5 files changed

+1
-40
lines changed

5 files changed

+1
-40
lines changed

google/cloud/storage/bucket_metadata.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,7 @@ BucketMetadataPatchBuilder& BucketMetadataPatchBuilder::SetEncryption(
368368
if (config.restriction_mode.empty()) return;
369369
builder.AddSubPatch(
370370
name, internal::PatchBuilder()
371-
.SetStringField("restrictionMode", config.restriction_mode)
372-
.SetStringField("effectiveTime",
373-
google::cloud::internal::FormatRfc3339(
374-
config.effective_time)));
371+
.SetStringField("restrictionMode", config.restriction_mode));
375372
};
376373
add_config_patch("googleManagedEncryptionEnforcementConfig",
377374
v.google_managed_encryption_enforcement_config);

google/cloud/storage/bucket_metadata_test.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -526,23 +526,14 @@ TEST(BucketMetadataTest, ToJsonString) {
526526
EXPECT_EQ("FullyRestricted",
527527
encryption["googleManagedEncryptionEnforcementConfig"].value(
528528
"restrictionMode", ""));
529-
EXPECT_EQ("2025-12-18T18:13:15Z",
530-
encryption["googleManagedEncryptionEnforcementConfig"].value(
531-
"effectiveTime", ""));
532529

533530
EXPECT_EQ("NotRestricted",
534531
encryption["customerManagedEncryptionEnforcementConfig"].value(
535532
"restrictionMode", ""));
536-
EXPECT_EQ("2025-12-18T18:13:15Z",
537-
encryption["customerManagedEncryptionEnforcementConfig"].value(
538-
"effectiveTime", ""));
539533

540534
EXPECT_EQ("NotRestricted",
541535
encryption["customerSuppliedEncryptionEnforcementConfig"].value(
542536
"restrictionMode", ""));
543-
EXPECT_EQ("2025-12-18T18:13:15Z",
544-
encryption["customerSuppliedEncryptionEnforcementConfig"].value(
545-
"effectiveTime", ""));
546537

547538
// hierarchical_namespace()
548539
ASSERT_EQ(1, actual.count("hierarchicalNamespace"));

google/cloud/storage/internal/bucket_metadata_parser.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,6 @@ void ToJsonEncryption(nlohmann::json& json, BucketMetadata const& meta) {
412412
if (config_source.restriction_mode.empty()) return;
413413
nlohmann::json config;
414414
config["restrictionMode"] = config_source.restriction_mode;
415-
config["effectiveTime"] =
416-
google::cloud::internal::FormatRfc3339(config_source.effective_time);
417415
e[name] = std::move(config);
418416
};
419417
to_json_config(

google/cloud/storage/internal/grpc/bucket_request_parser.cc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,6 @@ Status PatchLogging(Bucket& b, nlohmann::json const& l) {
163163
return Status{};
164164
}
165165

166-
google::protobuf::Timestamp ToProtoTimestamp(
167-
std::chrono::system_clock::time_point tp) {
168-
auto duration = tp.time_since_epoch();
169-
auto seconds = std::chrono::duration_cast<std::chrono::seconds>(duration);
170-
auto nanos =
171-
std::chrono::duration_cast<std::chrono::nanoseconds>(duration - seconds);
172-
google::protobuf::Timestamp ts;
173-
ts.set_seconds(seconds.count());
174-
ts.set_nanos(static_cast<std::int32_t>(nanos.count()));
175-
return ts;
176-
}
177166

178167
Status PatchEncryption(Bucket& b, nlohmann::json const& e) {
179168
if (e.is_null()) {
@@ -190,13 +179,6 @@ Status PatchEncryption(Bucket& b, nlohmann::json const& e) {
190179
if (c.contains("restrictionMode")) {
191180
mutable_config->set_restriction_mode(c.value("restrictionMode", ""));
192181
}
193-
if (c.contains("effectiveTime")) {
194-
auto ts =
195-
google::cloud::internal::ParseRfc3339(c.value("effectiveTime", ""));
196-
if (ts) {
197-
*mutable_config->mutable_effective_time() = ToProtoTimestamp(*ts);
198-
}
199-
}
200182
}
201183
};
202184

@@ -336,7 +318,6 @@ void UpdateEncryption(Bucket& bucket, storage::BucketMetadata const& metadata) {
336318
auto update_config = [&](auto const& source, auto* dest) {
337319
if (source.restriction_mode.empty()) return;
338320
dest->set_restriction_mode(source.restriction_mode);
339-
*dest->mutable_effective_time() = ToProtoTimestamp(source.effective_time);
340321
};
341322

342323
update_config(

google/cloud/storage/internal/grpc/bucket_request_parser_test.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,15 +461,12 @@ TEST(GrpcBucketRequestParser, PatchBucketRequestAllOptions) {
461461
default_kms_key: "test-only-kms-key"
462462
google_managed_encryption_enforcement_config {
463463
restriction_mode: "FullyRestricted"
464-
effective_time { seconds: 1766175572 }
465464
}
466465
customer_managed_encryption_enforcement_config {
467466
restriction_mode: "NotRestricted"
468-
effective_time { seconds: 1766175695 }
469467
}
470468
customer_supplied_encryption_enforcement_config {
471469
restriction_mode: "FullyRestricted"
472-
effective_time { seconds: 1766175739 }
473470
}
474471
}
475472
autoclass { enabled: true }
@@ -745,15 +742,12 @@ TEST(GrpcBucketRequestParser, UpdateBucketRequestAllOptions) {
745742
default_kms_key: "test-only-kms-key"
746743
google_managed_encryption_enforcement_config {
747744
restriction_mode: "FullyRestricted"
748-
effective_time { seconds: 1766176065 }
749745
}
750746
customer_managed_encryption_enforcement_config {
751747
restriction_mode: "NotRestricted"
752-
effective_time { seconds: 1766176105 }
753748
}
754749
customer_supplied_encryption_enforcement_config {
755750
restriction_mode: "FullyRestricted"
756-
effective_time { seconds: 1766176151 }
757751
}
758752
}
759753
autoclass { enabled: true }

0 commit comments

Comments
 (0)