Skip to content

Commit faa5f55

Browse files
authored
Merge pull request #3302 from crosbymichael/mkroot
Ensure that the rootfs dir is created in the bundle
2 parents d4e7efb + 7531c66 commit faa5f55

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

runtime/v1/linux/bundle.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ func newBundle(id, path, workDir string, spec []byte) (b *bundle, err error) {
6565
os.RemoveAll(workDir)
6666
}
6767
}()
68+
rootfs := filepath.Join(path, "rootfs")
69+
if err := os.MkdirAll(rootfs, 0711); err != nil {
70+
return nil, err
71+
}
6872
err = ioutil.WriteFile(filepath.Join(path, configFilename), spec, 0666)
6973
return &bundle{
7074
id: id,

runtime/v2/bundle.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ func NewBundle(ctx context.Context, root, state, id string, spec []byte) (b *Bun
7979
if err := os.MkdirAll(filepath.Dir(work), 0711); err != nil {
8080
return nil, err
8181
}
82+
rootfs := filepath.Join(b.Path, "rootfs")
83+
if err := os.MkdirAll(rootfs, 0711); err != nil {
84+
return nil, err
85+
}
86+
paths = append(paths, rootfs)
8287
if err := os.Mkdir(work, 0711); err != nil {
8388
if !os.IsExist(err) {
8489
return nil, err

0 commit comments

Comments
 (0)