[ Agent ] [ App ] - fix app bugs
This commit is contained in:
@@ -223,7 +223,7 @@ func (op *AgentOsOperator) deployK8sNamespace(funcArgs []string) (bool, []string
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true, []string{
|
return true, []string{
|
||||||
fmt.Sprintf("Namespace of [%s]create success !", funcArgs[1]),
|
fmt.Sprintf("Namespace of [%s] create success !", funcArgs[1]),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,6 +288,11 @@ func (op *AgentOsOperator) deployNFS(funcArgs []string) (bool, []string) {
|
|||||||
result = append(result, "命令不存在", "kubectl")
|
result = append(result, "命令不存在", "kubectl")
|
||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
folder, i := CheckAppInstallFolder()
|
||||||
|
if !folder {
|
||||||
|
return false, i
|
||||||
|
}
|
||||||
|
|
||||||
// 创建目录修改权限
|
// 创建目录修改权限
|
||||||
if !BasicFolderExists(nfsDataPath) {
|
if !BasicFolderExists(nfsDataPath) {
|
||||||
return false, []string{
|
return false, []string{
|
||||||
@@ -447,6 +452,10 @@ func (op *AgentOsOperator) deployMySQL(funcArgs []string) (bool, []string) {
|
|||||||
result = append(result, "命令不存在", "kubectl")
|
result = append(result, "命令不存在", "kubectl")
|
||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
folder, i := CheckAppInstallFolder()
|
||||||
|
if !folder {
|
||||||
|
return false, i
|
||||||
|
}
|
||||||
|
|
||||||
// 下载模板文件
|
// 下载模板文件
|
||||||
k8sMysqlYamlFile := "/root/wdd/install/k8s-mysql.yaml"
|
k8sMysqlYamlFile := "/root/wdd/install/k8s-mysql.yaml"
|
||||||
@@ -492,6 +501,11 @@ func (op *AgentOsOperator) deployMySQL(funcArgs []string) (bool, []string) {
|
|||||||
|
|
||||||
func (op *AgentOsOperator) loadMysqlInitScript(funcArgs []string) (bool, []string) {
|
func (op *AgentOsOperator) loadMysqlInitScript(funcArgs []string) (bool, []string) {
|
||||||
|
|
||||||
|
folder, i := CheckAppInstallFolder()
|
||||||
|
if !folder {
|
||||||
|
return false, i
|
||||||
|
}
|
||||||
|
|
||||||
// download offline sql list
|
// download offline sql list
|
||||||
if len(funcArgs) <= 7 {
|
if len(funcArgs) <= 7 {
|
||||||
return false, []string{
|
return false, []string{
|
||||||
@@ -609,6 +623,10 @@ func (op *AgentOsOperator) deployMiddlewares(funcArgs []string) (bool, []string)
|
|||||||
result = append(result, "命令不存在", "kubectl")
|
result = append(result, "命令不存在", "kubectl")
|
||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
folder, i := CheckAppInstallFolder()
|
||||||
|
if !folder {
|
||||||
|
return false, i
|
||||||
|
}
|
||||||
|
|
||||||
// 下载模板文件
|
// 下载模板文件
|
||||||
k8sMiddlewaresYamlFile := "/root/wdd/install/k8s-middlewares.yaml"
|
k8sMiddlewaresYamlFile := "/root/wdd/install/k8s-middlewares.yaml"
|
||||||
@@ -676,6 +694,10 @@ func (op *AgentOsOperator) deployRedis(funcArgs []string) (bool, []string) {
|
|||||||
result = append(result, "命令不存在", "kubectl")
|
result = append(result, "命令不存在", "kubectl")
|
||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
folder, i := CheckAppInstallFolder()
|
||||||
|
if !folder {
|
||||||
|
return false, i
|
||||||
|
}
|
||||||
|
|
||||||
// 下载模板文件
|
// 下载模板文件
|
||||||
k8sRedisYamlFile := "/root/wdd/install/k8s-redis.yaml"
|
k8sRedisYamlFile := "/root/wdd/install/k8s-redis.yaml"
|
||||||
@@ -739,6 +761,10 @@ func (op *AgentOsOperator) deployIngress(funcArgs []string) (bool, []string) {
|
|||||||
result = append(result, "命令不存在", commandName)
|
result = append(result, "命令不存在", commandName)
|
||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
folder, i := CheckAppInstallFolder()
|
||||||
|
if !folder {
|
||||||
|
return false, i
|
||||||
|
}
|
||||||
|
|
||||||
// 下载模板文件
|
// 下载模板文件
|
||||||
if !PureResultSingleExecute([]string{
|
if !PureResultSingleExecute([]string{
|
||||||
@@ -793,6 +819,10 @@ func (op *AgentOsOperator) deployFront(funcArgs []string) (bool, []string) {
|
|||||||
result = append(result, "命令不存在", commandName)
|
result = append(result, "命令不存在", commandName)
|
||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
folder, i := CheckAppInstallFolder()
|
||||||
|
if !folder {
|
||||||
|
return false, i
|
||||||
|
}
|
||||||
|
|
||||||
// 下载模板文件
|
// 下载模板文件
|
||||||
if !PureResultSingleExecute([]string{
|
if !PureResultSingleExecute([]string{
|
||||||
@@ -844,6 +874,10 @@ func (op *AgentOsOperator) initMinio(funcArgs []string) (bool, []string) {
|
|||||||
result = append(result, "命令不存在", commandName)
|
result = append(result, "命令不存在", commandName)
|
||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
folder, i := CheckAppInstallFolder()
|
||||||
|
if !folder {
|
||||||
|
return false, i
|
||||||
|
}
|
||||||
|
|
||||||
// 下载模板文件
|
// 下载模板文件
|
||||||
if !PureResultSingleExecute([]string{
|
if !PureResultSingleExecute([]string{
|
||||||
@@ -899,6 +933,10 @@ func (op *AgentOsOperator) deploySRS(funcArgs []string) (bool, []string) {
|
|||||||
result = append(result, "命令不存在", commandName)
|
result = append(result, "命令不存在", commandName)
|
||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
folder, i := CheckAppInstallFolder()
|
||||||
|
if !folder {
|
||||||
|
return false, i
|
||||||
|
}
|
||||||
|
|
||||||
// 下载模板文件
|
// 下载模板文件
|
||||||
if !PureResultSingleExecute([]string{
|
if !PureResultSingleExecute([]string{
|
||||||
|
|||||||
@@ -249,8 +249,8 @@ func K8sCreateNamespace(namespaceName string) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace, _ := k8sClient.CoreV1().Namespaces().Get(context.TODO(), namespaceName, metav1.GetOptions{})
|
namespace, err := k8sClient.CoreV1().Namespaces().Get(context.TODO(), namespaceName, metav1.GetOptions{})
|
||||||
if namespace != nil {
|
if err == nil {
|
||||||
log.InfoF("[K8sCreateNamespace] - namespace of [%s] already exists!", namespaceName)
|
log.InfoF("[K8sCreateNamespace] - namespace of [%s] already exists!", namespaceName)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -263,7 +263,6 @@ func K8sCreateNamespace(namespaceName string) bool {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
// 使用客户端创建命名空间
|
// 使用客户端创建命名空间
|
||||||
var err error
|
|
||||||
namespace, err = k8sClient.CoreV1().Namespaces().Create(context.TODO(), namespace, metav1.CreateOptions{})
|
namespace, err = k8sClient.CoreV1().Namespaces().Create(context.TODO(), namespace, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorF("Error getting namespace: %s ", err.Error())
|
log.ErrorF("Error getting namespace: %s ", err.Error())
|
||||||
@@ -273,7 +272,6 @@ func K8sCreateNamespace(namespaceName string) bool {
|
|||||||
// check namespace exists
|
// check namespace exists
|
||||||
// 尝试获取名为 "xxg" 的命名空间
|
// 尝试获取名为 "xxg" 的命名空间
|
||||||
namespace, err = k8sClient.CoreV1().Namespaces().Get(context.TODO(), namespaceName, metav1.GetOptions{})
|
namespace, err = k8sClient.CoreV1().Namespaces().Get(context.TODO(), namespaceName, metav1.GetOptions{})
|
||||||
|
|
||||||
// 如果返回错误,需要判断是因为命名空间不存在还是其他错误
|
// 如果返回错误,需要判断是因为命名空间不存在还是其他错误
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.IsNotFound(err) {
|
if errors.IsNotFound(err) {
|
||||||
|
|||||||
@@ -129,6 +129,10 @@ public class AppFuncScheduler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// must remove this one
|
||||||
|
appFuncArgs.remove(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user