mirror of
https://github.com/containers/podman
synced 2024-10-19 16:54:07 +00:00
Don't error if resolv.conf does not exists
If the resolv.conf file is empty we provide default dns servers. If the file does not exists we error and don't create the container. We should also provide the default entries in this case. This is also what docker does. Fixes #8089 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
This commit is contained in:
parent
d340f8523c
commit
f391849c22
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue