fix: reject network_state dns-resolver when NM global-dns is configured - #912
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change detects NetworkManager global DNS configuration before applying ChangesGlobal DNS validation
Merge Risk: ⚪ Minimal · up to dns-resolver requests now fail early with actionable guidance when file-based NetworkManager global DNS configuration makes the requested operation unsupported. The behavior is documented and covered for the relevant configuration paths, with no current merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8e98a8d to
cb972f1
Compare
|
[citest_all] |
nmstate stores and purges dns-resolver through NetworkManager's D-Bus global DNS API. NetworkManager refuses that while a [global-dns] or [global-dns-domain-*] section comes from a config file, and nmstate only reports the refusal as an internal error. Neither side plans to change this, so check the config files first and fail with an error naming the file and the workarounds. D-Bus-set global DNS lives in [.intern.*] groups and is not matched. Resolves: RHEL-4450 Signed-off-by: Josephine Pfeiffer <josie@redhat.com>
Reproduce the reported setup: a conf.d snippet with a [global-dns] section and a network_state that sets dns-resolver. The role must fail before calling nmstate and name global-dns in its error. Signed-off-by: Josephine Pfeiffer <josie@redhat.com>
Signed-off-by: Josephine Pfeiffer <josie@redhat.com>
cb972f1 to
cdb24d7
Compare
|
[citest_all] |
Enhancement:
The network_state module checks NetworkManager's configuration files (NetworkManager.conf and the conf.d directories) for a [global-dns] or [global-dns-domain-*] section before applying a state that contains dns-resolver, and fails with an error naming the file and the workarounds.
Reason:
nmstate stores and purges dns-resolver through NetworkManager's D-Bus global DNS API. NetworkManager refuses that call while global DNS comes from a configuration file, and nmstate surfaces the refusal as an "Global DNS configuration already set via configuration file" error, which the role forwarded as a module traceback. Neither NetworkManager nor nmstate plan to change this, so the role reports the configuration as unsupported, as agreed on in RHEL-4450.
Result:
Users with a [global-dns] section get an actionable error telling them to remove the section and reload NetworkManager, or to configure DNS on the connection profiles instead of dns-resolver. Global DNS set over D-Bus (what nmstate itself writes) lives in [.intern.*] groups and does not trigger the check.
Issue Tracker Tickets (Jira or BZ if any):
RHEL-4450, RHEL-3257, NMT-1833
Signed-off-by: Josephine Pfeiffer josie@redhat.com
Summary by CodeRabbit
Bug Fixes
dns-resolverconfigurations now fail with a clear explanation when NetworkManager global DNS settings are present, instead of producing an internal error.Documentation
Tests