summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-22 17:47:03 -0400
committerGitHub <noreply@github.com>2020-10-22 17:47:03 -0400
commit2adc1b284d7f61083d19e82822f79ea14c14de2d (patch)
tree3d13ec47eec86a511325cd14203b3ca2f664081e /libpod
parent8e06f8efbc9208cfe14d1091bf5a1ce10e605af9 (diff)
parentf391849c2282bba0b28f9bee5a7be5bff7bac623 (diff)
downloadpodman-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.go6
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)
}