Unverified Commit 74ce150e authored by Derek Nola's avatar Derek Nola Committed by GitHub

Allow additional Rootless CopyUpDirs through K3S_ROOTLESS_COPYUPDIRS env variable (#11043)

parent 7ed28c08
......@@ -32,6 +32,7 @@ var (
enableIPv6Env = "K3S_ROOTLESS_ENABLE_IPV6"
portDriverEnv = "K3S_ROOTLESS_PORT_DRIVER"
disableLoopbackEnv = "K3S_ROOTLESS_DISABLE_HOST_LOOPBACK"
copyUpDirsEnv = "K3S_ROOTLESS_COPYUPDIRS"
)
func Rootless(stateDir string, enableIPv6 bool) error {
......@@ -218,6 +219,9 @@ func createChildOpt(driver portDriver) (*child.Opt, error) {
opt.NetworkDriver = slirp4netns.NewChildDriver()
opt.PortDriver = driver.NewChildDriver()
opt.CopyUpDirs = []string{"/etc", "/var/run", "/run", "/var/lib"}
if copyUpDirs := os.Getenv(copyUpDirsEnv); copyUpDirs != "" {
opt.CopyUpDirs = append(opt.CopyUpDirs, strings.Split(copyUpDirs, ",")...)
}
opt.CopyUpDriver = tmpfssymlink.NewChildDriver()
opt.MountProcfs = true
opt.Reaper = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment