可以在集群中查看待安装节点、并直接安装节点

This commit is contained in:
刘祥超
2020-10-26 21:14:56 +08:00
parent 5869ad30ae
commit 60ceac7fad
11 changed files with 246 additions and 15 deletions

View File

@@ -23,6 +23,15 @@ func (this *NodeInstaller) Install(dir string, params interface{}) error {
return errors.New("params validation: " + err.Error())
}
// 检查目标目录是否存在
_, err = this.client.Stat(dir)
if err != nil {
err = this.client.MkdirAll(dir)
if err != nil {
return errors.New("create directory '" + dir + "' failed: " + err.Error())
}
}
// 安装助手
env, err := this.InstallHelper(dir)
if err != nil {