mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Merge pull request #536 from ibuildthecloud/master
rootless: fix mounting /var/lib/cni
This commit is contained in:
commit
32283aa8e2
@ -42,13 +42,17 @@ func setupMount(target, dir string) error {
|
||||
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")
|
||||
if err := unix.Mount("none", toCreate, "tmpfs", 0, ""); err != nil {
|
||||
return errors.Wrapf(err, "failed to mount tmpfs to %s", toCreate)
|
||||
}
|
||||
|
||||
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 == "" {
|
||||
@ -56,7 +60,7 @@ func setupMount(target, dir string) error {
|
||||
}
|
||||
|
||||
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")
|
||||
|
@ -128,7 +128,7 @@ func createChildOpt() (*child.Opt, error) {
|
||||
opt.PipeFDEnvKey = pipeFD
|
||||
opt.NetworkDriver = slirp4netns.NewChildDriver()
|
||||
opt.PortDriver = portbuiltin.NewChildDriver(&logrusDebugWriter{})
|
||||
opt.CopyUpDirs = []string{"/etc", "/run"}
|
||||
opt.CopyUpDirs = []string{"/etc", "/run", "/var/lib"}
|
||||
opt.CopyUpDriver = tmpfssymlink.NewChildDriver()
|
||||
return opt, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user