diff --git a/modules/base/conf.go b/modules/base/conf.go index d0f8ae2cc8..3eb01bdd56 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -274,6 +274,9 @@ func NewConfigContext() { RunUser = Cfg.MustValue("", "RUN_USER") curUser := os.Getenv("USERNAME") + if len(curUser) == 0 { + curUser = os.Getenv("whoami") + } if RunUser != curUser { fmt.Printf("Expect user(%s) but current user is: %s\n", RunUser, curUser) os.Exit(2)