mirror of https://github.com/k3s-io/k3s
Merge branch 'pr505'
commit
e0d2bd3e2d
|
@ -42,13 +42,17 @@ func setupMount(target, dir string) error {
|
||||||
toCreate = filepath.Base(toCreate)
|
toCreate = filepath.Base(toCreate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := os.MkdirAll(toCreate, 0700); err != nil {
|
||||||
|
return errors.Wrapf(err, "failed to create directory %s", toCreate)
|
||||||
|
}
|
||||||
|
|
||||||
logrus.Debug("Mounting none ", toCreate, " tmpfs")
|
logrus.Debug("Mounting none ", toCreate, " tmpfs")
|
||||||
if err := unix.Mount("none", toCreate, "tmpfs", 0, ""); err != nil {
|
if err := unix.Mount("none", toCreate, "tmpfs", 0, ""); err != nil {
|
||||||
return errors.Wrapf(err, "failed to mount tmpfs to %s", toCreate)
|
return errors.Wrapf(err, "failed to mount tmpfs to %s", toCreate)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.MkdirAll(target, 0700); err != nil {
|
if err := os.MkdirAll(target, 0700); err != nil {
|
||||||
return errors.Wrapf(err, "failed to create directory %s")
|
return errors.Wrapf(err, "failed to create directory %s", target)
|
||||||
}
|
}
|
||||||
|
|
||||||
if dir == "" {
|
if dir == "" {
|
||||||
|
@ -56,7 +60,7 @@ func setupMount(target, dir string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.MkdirAll(dir, 0700); err != nil {
|
if err := os.MkdirAll(dir, 0700); err != nil {
|
||||||
return errors.Wrapf(err, "failed to create directory %s")
|
return errors.Wrapf(err, "failed to create directory %s", dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
logrus.Debug("Mounting ", dir, target, " none bind")
|
logrus.Debug("Mounting ", dir, target, " none bind")
|
||||||
|
|
|
@ -128,7 +128,7 @@ func createChildOpt() (*child.Opt, error) {
|
||||||
opt.PipeFDEnvKey = pipeFD
|
opt.PipeFDEnvKey = pipeFD
|
||||||
opt.NetworkDriver = slirp4netns.NewChildDriver()
|
opt.NetworkDriver = slirp4netns.NewChildDriver()
|
||||||
opt.PortDriver = portbuiltin.NewChildDriver(&logrusDebugWriter{})
|
opt.PortDriver = portbuiltin.NewChildDriver(&logrusDebugWriter{})
|
||||||
opt.CopyUpDirs = []string{"/etc", "/run"}
|
opt.CopyUpDirs = []string{"/etc", "/run", "/var/lib"}
|
||||||
opt.CopyUpDriver = tmpfssymlink.NewChildDriver()
|
opt.CopyUpDriver = tmpfssymlink.NewChildDriver()
|
||||||
return opt, nil
|
return opt, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue