diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-03-07 14:10:19 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-08 16:40:21 +0000 |
commit | 54f32f2cc024090c3f284f7b0b6832f2b19a6660 (patch) | |
tree | f3a221a9d1fe522afa9f43cb72b4cb94552788d0 /libpod/container_api.go | |
parent | c657511bce7bc1c5da4b5554a4850aa4046711b0 (diff) | |
download | podman-54f32f2cc024090c3f284f7b0b6832f2b19a6660.tar.gz podman-54f32f2cc024090c3f284f7b0b6832f2b19a6660.tar.bz2 podman-54f32f2cc024090c3f284f7b0b6832f2b19a6660.zip |
Convert bind mounts to use DB field
Refactors creation of bind mounts into a separate function that
can be called from elsewhere (e.g. pod start or container
restart). This function stores the mounts in the DB using the
field established last commit.
Spec generation now relies upon this field in the DB instead of
manually enumerating files to be bind mounted in.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #462
Approved by: baude
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index 161cd938c..0a27da7c9 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -59,25 +59,12 @@ func (c *Container) Init() (err error) { } }() - // Copy /etc/resolv.conf to the container's rundir - runDirResolv, err := c.generateResolvConf() - if err != nil { + if err := c.makeBindMounts(); err != nil { return err } - // Copy /etc/hosts to the container's rundir - runDirHosts, err := c.generateHosts() - if err != nil { - return errors.Wrapf(err, "unable to copy /etc/hosts to container space") - } - - runDirHostname, err := c.generateEtcHostname(c.Hostname()) - if err != nil { - return errors.Wrapf(err, "unable to generate hostname file for container") - } - // Generate the OCI spec - spec, err := c.generateSpec(runDirResolv, runDirHosts, runDirHostname) + spec, err := c.generateSpec() if err != nil { return err } |