diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 6c0e1a499..6addffc22 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -511,13 +511,13 @@ type PDefaultTips struct { func init() { cfgName := os.Getenv("CONFIG_NAME") - fmt.Println(Root, cfgName) + fmt.Println("get config path is:", Root, cfgName) - if len(cfgName) == 0 { - cfgName = Root + "/config/config.yaml" + if len(cfgName) != 0 { + Root = cfgName } - bytes, err := ioutil.ReadFile(cfgName) + bytes, err := ioutil.ReadFile(filepath.Join(Root, "config", "config.yaml")) if err != nil { panic(err.Error()) }