Merge pull request #3302 from crosbymichael/mkroot
Ensure that the rootfs dir is created in the bundle
This commit is contained in:
commit
faa5f55189
@ -65,6 +65,10 @@ func newBundle(id, path, workDir string, spec []byte) (b *bundle, err error) {
|
|||||||
os.RemoveAll(workDir)
|
os.RemoveAll(workDir)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
rootfs := filepath.Join(path, "rootfs")
|
||||||
|
if err := os.MkdirAll(rootfs, 0711); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
err = ioutil.WriteFile(filepath.Join(path, configFilename), spec, 0666)
|
err = ioutil.WriteFile(filepath.Join(path, configFilename), spec, 0666)
|
||||||
return &bundle{
|
return &bundle{
|
||||||
id: id,
|
id: id,
|
||||||
|
@ -79,6 +79,11 @@ func NewBundle(ctx context.Context, root, state, id string, spec []byte) (b *Bun
|
|||||||
if err := os.MkdirAll(filepath.Dir(work), 0711); err != nil {
|
if err := os.MkdirAll(filepath.Dir(work), 0711); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
rootfs := filepath.Join(b.Path, "rootfs")
|
||||||
|
if err := os.MkdirAll(rootfs, 0711); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
paths = append(paths, rootfs)
|
||||||
if err := os.Mkdir(work, 0711); err != nil {
|
if err := os.Mkdir(work, 0711); err != nil {
|
||||||
if !os.IsExist(err) {
|
if !os.IsExist(err) {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user