Browse Source

Fix normal user with --rootless or --disable-agent have no permission to start

Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
pull/2793/head
JenTing Hsiao 4 years ago committed by Brad Davidson
parent
commit
3c7fd3d37b
  1. 4
      cmd/k3s/main.go

4
cmd/k3s/main.go

@ -57,7 +57,11 @@ func findDataDir() string {
}
dataDir := configfilearg.MustFindString(os.Args, "data-dir")
if dataDir == "" {
if os.Getuid() == 0 {
dataDir = datadir.DefaultDataDir
} else {
dataDir = datadir.DefaultHomeDataDir
}
logrus.Debug("Using default data dir in self-extracting wrapper")
}
return dataDir

Loading…
Cancel
Save