diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-22 17:47:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 17:47:03 -0400 |
commit | 2adc1b284d7f61083d19e82822f79ea14c14de2d (patch) | |
tree | 3d13ec47eec86a511325cd14203b3ca2f664081e /libpod | |
parent | 8e06f8efbc9208cfe14d1091bf5a1ce10e605af9 (diff) | |
parent | f391849c2282bba0b28f9bee5a7be5bff7bac623 (diff) | |
download | podman-2adc1b284d7f61083d19e82822f79ea14c14de2d.tar.gz podman-2adc1b284d7f61083d19e82822f79ea14c14de2d.tar.bz2 podman-2adc1b284d7f61083d19e82822f79ea14c14de2d.zip |
Merge pull request #8111 from Luap99/fix-missing-resolv.conf
Don't error if resolv.conf does not exists
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal_linux.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 2efe0d086..a1b4334fb 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -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 } @@ -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) } |