Fixed handling of zero values in retention attributes.#162
Fixed handling of zero values in retention attributes.#162jtaylor-cs merged 2 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the handling of zero values in the Terraform retention rule attributes, retention_count_limit and retention_day_limit. A zero value set of these attributes resulted in the value being overwritten with its default value:
retention_count_limit = 100
retention_day_limit = 28
Expectations:
Following the upgrade of the provider, a user may notice that a Terraform Plan/Apply action reflects changes to these limit attribute values. This occurs because the zero value is now recognized and is correcting the incorrectly set default value.
Key Changes:
- Modified the update logic to always send
retention_count_limit,retention_days_limit, andretention_size_limitvalues to the API, even when zero. - Updated test case to validate that zero values for retention limits persist correctly.
- Updated documentation for
retention_count_limitto include default value of 100. - Refined documentation for
retention_size_limitattribute to better reflect the maximum 20 GB limit and equivalent byte value.
|
Hey @jtaylor-cs -
|
@BartoszBlizniak, I followed your instructions to run the latest version and switch to the local build to see what differences occur. I edited the PR Overview to highlight the expectations. Please let me know if I need to expand the statement or place it in another documentation section. I consider API changes, and I don't think there are any at this time. The retention rule code recognizes a zero value as something that is skipped in the logic, so these updates actually reinforce that functionality, ensuring the user's desired value is set and persisted, thereby leading to the expected retention rule evaluation. |
Fixes the treatment of a zero value for the attributes
retention_count_limitandretention_day_limit, in which the zero value was overridden by the default value of the attribute.