summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorEduardo Vega <edvegavalerio@gmail.com>2020-09-11 19:57:48 -0600
committerEduardo Vega <edvegavalerio@gmail.com>2020-09-11 23:31:07 -0600
commit6a1233597aeb39139f5d9daef19e5e7f672b71ec (patch)
tree8912d2857476ce505444948fe819bfe07a4aa0d1 /libpod
parent37658c097654096cf64ea518a43312007b4741d4 (diff)
downloadpodman-6a1233597aeb39139f5d9daef19e5e7f672b71ec.tar.gz
podman-6a1233597aeb39139f5d9daef19e5e7f672b71ec.tar.bz2
podman-6a1233597aeb39139f5d9daef19e5e7f672b71ec.zip
Determine if resolv.conf points to systemd-resolved
Signed-off-by: Eduardo Vega <edvegavalerio@gmail.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal_linux.go5
1 files changed, 5 insertions, 0 deletions
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)