Skip to content

Commit

Permalink
potential fix for a crash in google_storage_bucket when providers u…
Browse files Browse the repository at this point in the history
…pgrade to `4.42.0` (#6758)
  • Loading branch information
shuyama1 authored Nov 1, 2022
1 parent f67f396 commit 13f6cd1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,6 @@ func flattenBucketLifecycleRuleAction(action *storage.BucketLifecycleRuleAction)

func flattenBucketLifecycleRuleCondition(condition *storage.BucketLifecycleRuleCondition) map[string]interface{} {
ruleCondition := map[string]interface{}{
"age": int(*condition.Age),
"created_before": condition.CreatedBefore,
"matches_storage_class": convertStringArrToInterface(condition.MatchesStorageClass),
"num_newer_versions": int(condition.NumNewerVersions),
Expand All @@ -1092,6 +1091,9 @@ func flattenBucketLifecycleRuleCondition(condition *storage.BucketLifecycleRuleC
"matches_prefix": convertStringArrToInterface(condition.MatchesPrefix),
"matches_suffix": convertStringArrToInterface(condition.MatchesSuffix),
}
if condition.Age != nil {
ruleCondition["age"] = int(*condition.Age)
}
if condition.IsLive == nil {
ruleCondition["with_state"] = "ANY"
} else {
Expand Down

0 comments on commit 13f6cd1

Please sign in to comment.