libnetwork/drivers/overlay: getBridgeNamePrefix() simplify reading of resolv.conf

We only need the content here, not the checksum, so simplifying the code by
just using os.ReadFile().

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-10-01 20:35:54 +02:00
parent 0ef0dab2f7
commit 0cbe6524db
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -531,8 +531,8 @@ func (n *network) getBridgeNamePrefix(s *subnet) string {
func checkOverlap(nw *net.IPNet) error {
var nameservers []string
if rc, err := resolvconf.Get(); err == nil {
nameservers = resolvconf.GetNameserversAsCIDR(rc.Content)
if rc, err := os.ReadFile(resolvconf.Path()); err == nil {
nameservers = resolvconf.GetNameserversAsCIDR(rc)
}
if err := netutils.CheckNameserverOverlaps(nameservers, nw); err != nil {