Skip to content

Commit

Permalink
Determine if resolv.conf points to systemd-resolved
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Vega <[email protected]>
  • Loading branch information
EduardoVega committed Sep 12, 2020
1 parent 37658c0 commit 6a12335
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 6a12335

Please sign in to comment.