Skip to content

Commit

Permalink
Fixes storage bucket custom_time_before/noncurrent_time_before update…
Browse files Browse the repository at this point in the history
  • Loading branch information
kautikdk authored and ma-g-22 committed May 21, 2024
1 parent eb80e51 commit a7b411d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,14 @@ func resourceGCSBucketLifecycleRuleConditionHash(v interface{}) int {
buf.WriteString(fmt.Sprintf("%s-", v.(string)))
}

if v, ok := m["custom_time_before"]; ok {
buf.WriteString(fmt.Sprintf("%s-", v.(string)))
}

if v, ok := m["noncurrent_time_before"]; ok {
buf.WriteString(fmt.Sprintf("%s-", v.(string)))
}

withStateV, withStateOk := m["with_state"]
if withStateOk {
switch withStateV.(string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1955,6 +1955,14 @@ resource "google_storage_bucket" "bucket" {
custom_time_before = "2019-01-01"
}
}
lifecycle_rule {
action {
type = "Delete"
}
condition {
noncurrent_time_before = "2019-01-01"
}
}
lifecycle_rule {
action {
type = "SetStorageClass"
Expand Down Expand Up @@ -2043,7 +2051,15 @@ resource "google_storage_bucket" "bucket" {
type = "Delete"
}
condition {
custom_time_before = "2019-01-01"
custom_time_before = "2019-01-12"
}
}
lifecycle_rule {
action {
type = "Delete"
}
condition {
noncurrent_time_before = "2019-01-12"
}
}
lifecycle_rule {
Expand Down

0 comments on commit a7b411d

Please sign in to comment.