summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go17
1 files changed, 5 insertions, 12 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 9a4f50079..be7fd76bc 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -79,22 +79,15 @@ func (c *Container) Init() (err error) {
}
// Copy /etc/resolv.conf to the container's rundir
- resolvPath := "/etc/resolv.conf"
-
- // Check if the host system is using system resolve and if so
- // copy its resolv.conf
- _, err = os.Stat("/run/systemd/resolve/resolv.conf")
- if err == nil {
- resolvPath = "/run/systemd/resolve/resolv.conf"
- }
- runDirResolv, err := c.copyHostFileToRundir(resolvPath)
+ runDirResolv, err := c.generateResolvConf()
if err != nil {
- return errors.Wrapf(err, "unable to copy resolv.conf to ", runDirResolv)
+ return err
}
+
// Copy /etc/hosts to the container's rundir
- runDirHosts, err := c.copyHostFileToRundir("/etc/hosts")
+ runDirHosts, err := c.generateHosts()
if err != nil {
- return errors.Wrapf(err, "unable to copy /etc/hosts to ", runDirHosts)
+ return errors.Wrapf(err, "unable to copy /etc/hosts to container space")
}
// Save OCI spec to disk