|
@@ -49,15 +49,14 @@ func showVersion() {
|
|
|
|
|
|
func prepare(appname, projectName, runmode, key, logDir string, etcdAddrs []string, discoveryType string) {
|
|
func prepare(appname, projectName, runmode, key, logDir string, etcdAddrs []string, discoveryType string) {
|
|
var conf *config.Configure
|
|
var conf *config.Configure
|
|
-
|
|
|
|
if discoveryType == "k8s" {
|
|
if discoveryType == "k8s" {
|
|
conf = config.GetConfigForK8s()
|
|
conf = config.GetConfigForK8s()
|
|
if conf == nil {
|
|
if conf == nil {
|
|
fmt.Printf("get conf failed\n\n")
|
|
fmt.Printf("get conf failed\n\n")
|
|
os.Exit(1)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
|
|
|
|
|
|
+ } else {
|
|
// 先行于读配置
|
|
// 先行于读配置
|
|
clinit.InitEtcd(etcdAddrs)
|
|
clinit.InitEtcd(etcdAddrs)
|
|
utils.SetEtcdKeyApi(clinit.GetEtcdClient())
|
|
utils.SetEtcdKeyApi(clinit.GetEtcdClient())
|
|
@@ -66,6 +65,7 @@ func prepare(appname, projectName, runmode, key, logDir string, etcdAddrs []stri
|
|
fmt.Printf("get conf failed\n\n")
|
|
fmt.Printf("get conf failed\n\n")
|
|
os.Exit(1)
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
// 指定mysql数据库,若无则使用默认数据库
|
|
// 指定mysql数据库,若无则使用默认数据库
|