domain_record TTLs are not rounded to closest valid values when diffing#755
Open
mgwoj wants to merge 4 commits intolinode:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes idempotency issues in the linode.cloud.domain_record module when users provide a ttl_sec that the Linode API rounds to the nearest accepted TTL value, which previously caused perpetual diffs on subsequent runs.
Changes:
- Added local TTL normalization to the nearest valid TTL value during create/update of domain records.
- Expanded integration coverage to validate TTL rounding behavior (including min/max bounds) and idempotency with invalid TTL inputs.
- Updated module/docs parameter descriptions to document valid TTL values and rounding behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
plugins/modules/domain_record.py |
Normalizes ttl_sec to the nearest accepted TTL value before create/update to prevent spurious diffs. |
tests/integration/targets/domain_record/tasks/main.yaml |
Adds integration assertions for TTL rounding and idempotency when an invalid TTL is provided. |
docs/modules/domain_record.md |
Documents valid TTL values and clarifies that invalid values are rounded to the nearest valid TTL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
ttl_secfromdomain_recordis accepting any integer value, but API is rounding it to nearest accepted value, causing diff on update. As a solution we also perform this rounding locally.✔️ How to Test
ansible-test integration domain_record