fix: suppress DNS name case drift caused by NetBox lowercasing#863
Merged
fbreckle merged 2 commits intoe-breuninger:masterfrom Apr 20, 2026
Merged
fix: suppress DNS name case drift caused by NetBox lowercasing#863fbreckle merged 2 commits intoe-breuninger:masterfrom
fbreckle merged 2 commits intoe-breuninger:masterfrom
Conversation
NetBox automatically converts DNS names to lowercase. Add DiffSuppressFunc using strings.EqualFold to prevent false configuration drift when users specify mixed-case dns_name values. Fixes e-breuninger#828.
Collaborator
|
Can you add a testcase that fails without your fix but works once the fix is applied? |
Contributor
Author
sure thing |
fbreckle
reviewed
Apr 9, 2026
3edbb72 to
bc64e9b
Compare
MrKeiKun
commented
Apr 9, 2026
Uses a mixed-case dns_name to verify NetBox's lowercasing does not cause false configuration drift. Without the DiffSuppressFunc fix, the post-apply plan check fails with "the plan was not empty".
bc64e9b to
0d95a30
Compare
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.
Problem
NetBox automatically converts DNS names to lowercase (see NetBox IP models). When users specify a mixed-case
dns_name(e.g.Host.Example.Com), the provider sees a difference between the config value and the stored lowercase value, causing false configuration drift on every subsequent plan.Solution
Add a
DiffSuppressFuncusingstrings.EqualFoldto thedns_namefield in bothnetbox_ip_addressandnetbox_available_ip_address, suppressing diffs that differ only in case. This mirrors the fix applied tomac_addressin #446.Fixes: #828.