Closed
Description
Issue with com.google.cloud.storage.Storage#update(com.google.cloud.storage.BucketInfo, com.google.cloud.storage.Storage.BucketTargetOption...)
Expected behaviour:
update only fields that are specified in BucketInfo
parameter.
Actual behaviour:
along the updated fields, removes lifecycle rules if they are not specified.
Example code:
val bucketId = "[...]"
val client = StorageOptions.getDefaultInstance.getService
val before = client.get(bucketId)
println(s"Before: ${before.getLifecycleRules.size()}")
val updateRequest = BucketInfo
.newBuilder(bucketId)
.setLabels(singletonMap("test", "test"))
.build
client.update(updateRequest)
val after = client.get(bucketId)
println(s"After: ${after.getLifecycleRules.size()}")
Actual output (for bucket with 1 lifecycle rule):
Before: 1
After: 0
I suspect that issue is located here: