Closed dbuenoparedes closed 1 month ago
This is by design, although you are not deleting the policy, just the rule within the policy. When you create a policy you then apply the first rule to the policy. You cannot change the parameters of a rule, you must add a new rule. What you are trying to do is add a new rule with the same snapshot interval (snap_every) but with a different retention (snap_keep_for) period. This is not allowed under Purity rules - the snapshot interval must be unique for each rule in the same policy. We could probably add a warning though
I have enhanced the idempotency for snapshot policy rules with #569
Thanks @sdodsley, my bad on mixing the terms of snapshot policies and rules within the policies, as you pointed out I was trying to modify an rule defined inside a snapshot policy. Actually each snapshot policy can have multiple rules inside of it.
I wasn't aware of that limitation/enforcement from the Purity side. You're 100% correct, I checked CLI and UI and I can't make changes to existing rules, only delete them or create new ones.
Thanks for proactively enhancing the idempotency.
No further action needed.
Describe the bug When creating new snapshot policies the module works fine, it creates it with the specified settings. Although when updating an existing policy's values it doesn't do anything, seems that it doesn't check current frequency nor retention (every / keep_for) values and just checks if the policy exists with the given name.
To Reproduce Steps to reproduce the behavior:
snap_keep_for
from 10080 to 20160 (1 week to 2 weeks), run the same task, I get the following output:Expected behavior Scheduled policy module should update existing schedule policy's configuration.
Desktop (please complete the following information):
Additional context I haven't tried changing other values nor other policies (like quota), not sure if they could also be affected by this.