Skip to content

Commit

Permalink
Merge pull request #6250 from simongh/storagement-management-policy-fix
Browse files Browse the repository at this point in the history
Changed management policy to only send set properties
  • Loading branch information
tombuildsstuff authored Mar 26, 2020
2 parents 1cf46ec + 625b397 commit 0c4d2f6
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,33 +294,21 @@ func expandStorageManagementPolicyRule(d *schema.ResourceData, ruleIndex int) (s
if _, ok := d.GetOk(fmt.Sprintf("rule.%d.actions.0.base_blob", ruleIndex)); ok {
baseBlob := &storage.ManagementPolicyBaseBlob{}
if v, ok := d.GetOk(fmt.Sprintf("rule.%d.actions.0.base_blob.0.tier_to_cool_after_days_since_modification_greater_than", ruleIndex)); ok {
if v == nil {
baseBlob.TierToCool = &storage.DateAfterModification{
DaysAfterModificationGreaterThan: nil,
}
} else {
if v != nil {
baseBlob.TierToCool = &storage.DateAfterModification{
DaysAfterModificationGreaterThan: utils.Float(float64(v.(int))),
}
}
}
if v, ok := d.GetOk(fmt.Sprintf("rule.%d.actions.0.base_blob.0.tier_to_archive_after_days_since_modification_greater_than", ruleIndex)); ok {
if v == nil {
baseBlob.TierToArchive = &storage.DateAfterModification{
DaysAfterModificationGreaterThan: nil,
}
} else {
if v != nil {
baseBlob.TierToArchive = &storage.DateAfterModification{
DaysAfterModificationGreaterThan: utils.Float(float64(v.(int))),
}
}
}
if v, ok := d.GetOk(fmt.Sprintf("rule.%d.actions.0.base_blob.0.delete_after_days_since_modification_greater_than", ruleIndex)); ok {
if v == nil {
baseBlob.Delete = &storage.DateAfterModification{
DaysAfterModificationGreaterThan: nil,
}
} else {
if v != nil {
baseBlob.Delete = &storage.DateAfterModification{
DaysAfterModificationGreaterThan: utils.Float(float64(v.(int))),
}
Expand Down

0 comments on commit 0c4d2f6

Please sign in to comment.