diff --git a/cmd/k3s/main.go b/cmd/k3s/main.go index 893afe0dcd..aee99fe017 100644 --- a/cmd/k3s/main.go +++ b/cmd/k3s/main.go @@ -57,7 +57,11 @@ func findDataDir() string { } dataDir := configfilearg.MustFindString(os.Args, "data-dir") 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") } return dataDir