mirror of
https://github.com/containers/podman.git
synced 2025-10-16 10:43:52 +08:00
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
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user