mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-03 01:01:06 +00:00
condition.IsLive can come back nil - avoid crash if it does. (#997)
This commit is contained in:
parent
0133845a19
commit
535fc64a14
@ -546,13 +546,16 @@ func flattenBucketLifecycleRuleAction(action *storage.BucketLifecycleRuleAction)
|
||||
}
|
||||
|
||||
func flattenBucketLifecycleRuleCondition(condition *storage.BucketLifecycleRuleCondition) map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
ruleCondition := map[string]interface{}{
|
||||
"age": int(condition.Age),
|
||||
"created_before": condition.CreatedBefore,
|
||||
"is_live": *condition.IsLive,
|
||||
"matches_storage_class": convertStringArrToInterface(condition.MatchesStorageClass),
|
||||
"num_newer_versions": int(condition.NumNewerVersions),
|
||||
}
|
||||
if condition.IsLive != nil {
|
||||
ruleCondition["is_live"] = *condition.IsLive
|
||||
}
|
||||
return ruleCondition
|
||||
}
|
||||
|
||||
func resourceGCSBucketLifecycleCreateOrUpdate(d *schema.ResourceData, sb *storage.Bucket) error {
|
||||
|
Loading…
Reference in New Issue
Block a user