Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release-1.30] Allow additional Rootless CopyUpDirs through K3S_ROOTLESS_COPYUPDIRS #11044

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/rootless/rootless.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
Loading