From 6a1233597aeb39139f5d9daef19e5e7f672b71ec Mon Sep 17 00:00:00 2001 From: Eduardo Vega Date: Fri, 11 Sep 2020 19:57:48 -0600 Subject: Determine if resolv.conf points to systemd-resolved Signed-off-by: Eduardo Vega --- libpod/container_internal_linux.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 86a28c176..3bdf28e8c 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -1383,6 +1383,11 @@ func (c *Container) generateResolvConf() (string, error) { return "", err } + // Determine if symlink points to any of the systemd-resolved files + if strings.HasPrefix(resolvPath, "/run/systemd/resolve/") { + resolvPath = "/run/systemd/resolve/resolv.conf" + } + contents, err := ioutil.ReadFile(resolvPath) if err != nil { return "", errors.Wrapf(err, "unable to read %s", resolvPath) -- cgit v1.2.3-54-g00ecf