File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change
1
+ ```release-note:bug
2
+ storage: fixed a crash in `google_storage_bucket` when upgrading provider to version `4.42.0` with `lifecycle_rule.condition.age` unset
3
+ ```
Original file line number Diff line number Diff line change @@ -1080,7 +1080,6 @@ func flattenBucketLifecycleRuleAction(action *storage.BucketLifecycleRuleAction)
1080
1080
1081
1081
func flattenBucketLifecycleRuleCondition (condition * storage.BucketLifecycleRuleCondition ) map [string ]interface {} {
1082
1082
ruleCondition := map [string ]interface {}{
1083
- "age" : int (* condition .Age ),
1084
1083
"created_before" : condition .CreatedBefore ,
1085
1084
"matches_storage_class" : convertStringArrToInterface (condition .MatchesStorageClass ),
1086
1085
"num_newer_versions" : int (condition .NumNewerVersions ),
@@ -1091,6 +1090,9 @@ func flattenBucketLifecycleRuleCondition(condition *storage.BucketLifecycleRuleC
1091
1090
"matches_prefix" : convertStringArrToInterface (condition .MatchesPrefix ),
1092
1091
"matches_suffix" : convertStringArrToInterface (condition .MatchesSuffix ),
1093
1092
}
1093
+ if condition .Age != nil {
1094
+ ruleCondition ["age" ] = int (* condition .Age )
1095
+ }
1094
1096
if condition .IsLive == nil {
1095
1097
ruleCondition ["with_state" ] = "ANY"
1096
1098
} else {
You can’t perform that action at this time.
0 commit comments