summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-14 03:45:20 -0400
committerGitHub <noreply@github.com>2020-09-14 03:45:20 -0400
commitb7936b552f33435aff7495531447ce032adc79e2 (patch)
tree67e6b9a995c6e2451e8e8e270ccaaae846712797
parent3f5f99b8839c391f3bc2450ac0c5ddc6960c88b9 (diff)
parent6a1233597aeb39139f5d9daef19e5e7f672b71ec (diff)
downloadpodman-b7936b552f33435aff7495531447ce032adc79e2.tar.gz
podman-b7936b552f33435aff7495531447ce032adc79e2.tar.bz2
podman-b7936b552f33435aff7495531447ce032adc79e2.zip
Merge pull request #7616 from EduardoVega/5845-support-for-systemd-resolved
Determine if resolv.conf points to systemd-resolved
-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)