From a517af2d93ad103c4d68be79db771c1bd69795b3 Mon Sep 17 00:00:00 2001 From: Thomas MacLean Date: Tue, 24 Oct 2023 17:12:58 -0400 Subject: [PATCH] Tests pass against test environment. --- .../services/storage/resource_storage_bucket_object.go | 3 +++ .../services/storage/resource_storage_bucket_object_test.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mmv1/third_party/terraform/services/storage/resource_storage_bucket_object.go b/mmv1/third_party/terraform/services/storage/resource_storage_bucket_object.go index c0f2b63d8920..1eece93ca437 100644 --- a/mmv1/third_party/terraform/services/storage/resource_storage_bucket_object.go +++ b/mmv1/third_party/terraform/services/storage/resource_storage_bucket_object.go @@ -390,6 +390,9 @@ func resourceStorageBucketObjectUpdate(d *schema.ResourceData, meta interface{}) if hasRetentionChanges { if v, ok := d.GetOk("retention"); ok { res.Retention = expandObjectRetention(v) + } else { + res.Retention = nil + res.NullFields = append(res.NullFields, "Retention") } } diff --git a/mmv1/third_party/terraform/services/storage/resource_storage_bucket_object_test.go b/mmv1/third_party/terraform/services/storage/resource_storage_bucket_object_test.go index 37386f9a3840..fbad5d66339b 100644 --- a/mmv1/third_party/terraform/services/storage/resource_storage_bucket_object_test.go +++ b/mmv1/third_party/terraform/services/storage/resource_storage_bucket_object_test.go @@ -436,13 +436,13 @@ func TestAccStorageObject_retention(t *testing.T) { CheckDestroy: testAccStorageObjectDestroyProducer(t), Steps: []resource.TestStep{ { - Config: testGoogleStorageBucketsObjectRetention(bucketName, "2040-01-01T02:03:04Z"), + Config: testGoogleStorageBucketsObjectRetention(bucketName, "2040-01-01T02:03:04.000Z"), Check: resource.ComposeTestCheckFunc( testAccCheckGoogleStorageObject(t, bucketName, objectName, dataMd5), ), }, { - Config: testGoogleStorageBucketsObjectRetention(bucketName, "2040-01-02T02:03:04Z"), + Config: testGoogleStorageBucketsObjectRetention(bucketName, "2040-01-02T02:03:04.000Z"), Check: resource.ComposeTestCheckFunc( testAccCheckGoogleStorageObject(t, bucketName, objectName, dataMd5), ),