Bug 2039541

Summary: Resolv-prepender script duplicating entries
Product: OpenShift Container Platform Reporter: Ben Nemec <bnemec>
Component: Machine Config OperatorAssignee: Ben Nemec <bnemec>
Machine Config Operator sub component: platform-baremetal QA Contact: Victor Voronkov <vvoronko>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: aos-bugs, tsedovic
Version: 4.10   
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-12 04:40:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Nemec 2022-01-11 21:54:10 UTC
Description of problem: When the resolv-prepender runs, it is duplicating the prepended address. For example, when starting from a resolv.conf that looks like:

# Generated by NetworkManager
search ostest.test.metalkube.org
nameserver 8.8.8.8
nameserver 192.168.111.1

we get:
# Generated by KNI resolv prepender NM dispatcher script
search ostest.test.metalkube.org
nameserver 192.168.111.23
nameserver 8.8.8.8
nameserver 192.168.111.23
# nameserver 192.168.111.1

It looks like what is happening is that the local nameserver is being prepended before each existing nameserver line instead of just the first. I think this is because of https://github.com/openshift/machine-config-operator/commit/09fab1e853418bfd8624db0a617411603e7b6876

Version-Release number of MCO (Machine Config Operator) (if applicable): NA

Platform (AWS, VSphere, Metal, etc.): On-prem

Are you certain that the root cause of the issue being reported is the MCO (Machine Config Operator)?
(Y/N/Not sure): Yes, it's the prepender script that lives in MCO.

How reproducible: Always.

Did you catch this issue by running a Jenkins job? If yes, please list:
1. Jenkins job:

2. Profile:

Steps to Reproduce:
1. Deploy cluster
2. Modify DNS settings to have multiple servers. I used kubernetes-nmstate to add a DNS server.
3.

Actual results: Duplicate local nameserver entries.

Expected results: Only one local nameserver entry.

Comment 6 errata-xmlrpc 2022-03-12 04:40:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056