Skip to content

Commit

Permalink
Merge pull request #7616 from EduardoVega/5845-support-for-systemd-re…
Browse files Browse the repository at this point in the history
…solved

Determine if resolv.conf points to systemd-resolved
  • Loading branch information
openshift-merge-robot authored Sep 14, 2020
2 parents 3f5f99b + 6a12335 commit b7936b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libpod/container_internal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b7936b5

Please sign in to comment.