Skip to content

Commit

Permalink
Merge pull request #8111 from Luap99/fix-missing-resolv.conf
Browse files Browse the repository at this point in the history
Don't error if resolv.conf does not exists
  • Loading branch information
openshift-merge-robot authored Oct 22, 2020
2 parents 8e06f8e + f391849 commit 2adc1b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libpod/container_internal_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,8 @@ func (c *Container) generateResolvConf() (string, error) {

// Determine the endpoint for resolv.conf in case it is a symlink
resolvPath, err := filepath.EvalSymlinks(resolvConf)
if err != nil {
// resolv.conf doesn't have to exists
if err != nil && !os.IsNotExist(err) {
return "", err
}

Expand All @@ -1422,7 +1423,8 @@ func (c *Container) generateResolvConf() (string, error) {
}

contents, err := ioutil.ReadFile(resolvPath)
if err != nil {
// resolv.conf doesn't have to exists
if err != nil && !os.IsNotExist(err) {
return "", errors.Wrapf(err, "unable to read %s", resolvPath)
}

Expand Down

0 comments on commit 2adc1b2

Please sign in to comment.