mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Fix normal user with --rootless or --disable-agent have no permission to start
Signed-off-by: JenTing Hsiao <jenting.hsiao@suse.com>
This commit is contained in:
parent
6dabf7ac61
commit
3c7fd3d37b
@ -57,7 +57,11 @@ func findDataDir() string {
|
|||||||
}
|
}
|
||||||
dataDir := configfilearg.MustFindString(os.Args, "data-dir")
|
dataDir := configfilearg.MustFindString(os.Args, "data-dir")
|
||||||
if dataDir == "" {
|
if dataDir == "" {
|
||||||
dataDir = datadir.DefaultDataDir
|
if os.Getuid() == 0 {
|
||||||
|
dataDir = datadir.DefaultDataDir
|
||||||
|
} else {
|
||||||
|
dataDir = datadir.DefaultHomeDataDir
|
||||||
|
}
|
||||||
logrus.Debug("Using default data dir in self-extracting wrapper")
|
logrus.Debug("Using default data dir in self-extracting wrapper")
|
||||||
}
|
}
|
||||||
return dataDir
|
return dataDir
|
||||||
|
Loading…
Reference in New Issue
Block a user