[ Agent ] [ App ] - offline fix bugs

This commit is contained in:
zeaslity
2023-12-15 14:56:34 +08:00
parent a3185f0241
commit 3312052645
4 changed files with 66 additions and 16 deletions

View File

@@ -158,7 +158,7 @@ func (op *AgentOsOperator) deployRke(funcArgs []string) (bool, []string) {
"[deployRke] - ip args error !",
}
}
if !BasicReplace("/root/wdd/rke-cluster.yml", "A1C2IP", funcArgs[0]) {
if !BasicReplace("/root/wdd/cluster.yml", "A1C2IP", funcArgs[0]) {
log.ErrorF("[deployRke] - rke config replace error !")
}
@@ -347,6 +347,10 @@ func (op *AgentOsOperator) deployTestNFS(funcArgs []string) (bool, []string) {
result = append(result, "命令不存在", "kubectl")
return false, result
}
folder, i := CheckAppInstallFolder()
if !folder {
return false, i
}
// 下载模板文件
k8sNFSYamlFile := "/root/wdd/install/k8s-nfs-test.yaml"
@@ -373,8 +377,9 @@ func (op *AgentOsOperator) deployTestNFS(funcArgs []string) (bool, []string) {
}
// 测试文件是否存在
if !BasicFileExists(nfsDataPath + "/default-test-claim-pvc*/NFS-CREATE-SUCCESS") {
result = append(result, "NFS 文件写入 异常!!")
commandExecutor, _ := HardCodeCommandExecutor("test -f " + nfsDataPath + "/default-test-claim-pvc*/NFS-CREATE-SUCCESS")
if !commandExecutor {
log.WarnF("[deployTestNFS] - test nfs file write error !")
}
if !K8sCheckPodStatusTimeout("test-pod", "default", 30) {
@@ -399,6 +404,10 @@ func (op *AgentOsOperator) deployPVC(funcArgs []string) (bool, []string) {
result = append(result, "命令不存在", "kubectl")
return false, result
}
folder, i := CheckAppInstallFolder()
if !folder {
return false, i
}
// 下载模板文件
k8sPvcYamlFile := "/root/wdd/install/k8s-pvc.yaml"