-
Notifications
You must be signed in to change notification settings - Fork 833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/renderer/sysconfig: also use dns information from interface config #5401
Conversation
ece2bf6
to
94ad377
Compare
Thanks for finding and quickly fixing this issue! I'm wondering if we should check the other renderers to see if this problem persists across them. Is it worth adding a unit test to capture this edge case? |
94ad377
to
bdc5195
Compare
yes I got lazy and did not add the unit test changes. I did now. It should check most combinations if not all. |
sysconfig renderer currently only uses global dns and search domain configuration in order to populate /etc/resolv.conf. This means it ignores interface specific dns configuration completely. This means, when global dns information is absent and only interface specific dns configuration is present, /etc/resolv.conf will not have complete dns information. Fix this so that per interface dns information is also taken into account along with global dns configuration in order to populate /etc/resolv.conf. Fixes: canonicalGH-5400 Signed-off-by: Ani Sinha <anisinha@redhat.com>
bdc5195
to
7987b85
Compare
Thanks for addressing this! Network ifcfg files support DNS and search, correct? For DNS defined at the interface level, shouldn't we store DNS there instead? E.g., if I use network v2:
I get a config file like:
and nothing in resolv.conf. The code to do it is here, though it looks like it's only limited static addresses. If that restriction was removed, I believe it should also work for v1. Also, do you know how much usage the sysconfig renderer gets these days? I was under the assumption that the network-manager renderer is used on RHEL and RHEL-derived systems these days and that the sysconfig renderer is more-or-less legacy. Is that not true? |
Yes we are doing that already.
Yes so here the search domain is added.
Indeed and this is where the problem lies. It should be added to resolv.conf as well. At least that is what the spec also says. See my description in #5400 .
sysconfig renderer in RHEL9 is the default and is widely used. network manager renderer in RHEL 9 is "opt in".
No. For RHEL9, sysconfig is default and network manager is opt in. For RHEL10, we plan to make network manager the default. sysconfig renderer probably won't work since support for ifcfg files with use of network manager will be dropped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least that is what the spec also says.
Just to be clear, this is documentation and not a spec. In this case, the documentation is incorrect because sysconfig is the only renderer that modifies resolv.conf at all, and so it really isn't valid for any other renderers.
While I still think using interface-specific ifcfg options is preferable, this does solve the problem and will improve things when using sysconfig, so +1 from me.
sysconfig renderer currently only uses global dns and search domain configuration in order to populate /etc/resolv.conf. This means it ignores interface specific dns configuration completely. This means, when global dns information is absent and only interface specific dns configuration is present, /etc/resolv.conf will not have complete dns information. Fix this so that per interface dns information is also taken into account along with global dns configuration in order to populate /etc/resolv.conf. Fixes: GH-5400 Signed-off-by: Ani Sinha <anisinha@redhat.com>
sysconfig renderer currently only uses global dns and search domain
configuration in order to populate /etc/resolv.conf. This means it ignores
interface specific dns configuration completely. This means, when global dns
information is absent and only interface specific dns configuration is present,
/etc/resolv.conf will not have complete dns information. Fix this so that
per interface dns information is also taken into account along with global dns
configuration in order to populate /etc/resolv.conf.
Fixes: GH-5400
tox
results looks good