diff --git a/.github/workflows/module_controller_ci_build_batch_deploy_to_aliyun.yml b/.github/workflows/module_controller_ci_build_batch_deploy_to_aliyun.yml index 03dd7778f..8f0cb7d87 100644 --- a/.github/workflows/module_controller_ci_build_batch_deploy_to_aliyun.yml +++ b/.github/workflows/module_controller_ci_build_batch_deploy_to_aliyun.yml @@ -184,7 +184,7 @@ jobs: # 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值 field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers) - if [ "$field_value" == "" ]; then + if [ "$field_value" == "0" ]; then echo "字段值已满足条件,执行分组确认" kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge exit 0 @@ -368,7 +368,7 @@ jobs: # 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值 field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers) - if [ "$field_value" == "" ]; then + if [ "$field_value" == "0" ]; then echo "字段值已满足条件,执行分组确认" kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge exit 0 @@ -509,7 +509,7 @@ jobs: # 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值 field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers) - if [ "$field_value" == "" ]; then + if [ "$field_value" == "0" ]; then echo "字段值已满足条件,执行分组确认" kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge exit 0 diff --git a/.github/workflows/module_controller_ci_build_batch_scaleup_then_scaledown_deploy_to_aliyun.yml b/.github/workflows/module_controller_ci_build_batch_scaleup_then_scaledown_deploy_to_aliyun.yml index 3e00b2e54..7dfad5f87 100644 --- a/.github/workflows/module_controller_ci_build_batch_scaleup_then_scaledown_deploy_to_aliyun.yml +++ b/.github/workflows/module_controller_ci_build_batch_scaleup_then_scaledown_deploy_to_aliyun.yml @@ -184,7 +184,7 @@ jobs: # 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值 field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers) - if [ "$field_value" == "" ]; then + if [ "$field_value" == "0" ]; then echo "字段值已满足条件,执行分组确认" kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge exit 0 @@ -595,7 +595,7 @@ jobs: # 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值 field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers) - if [ "$field_value" == "" ]; then + if [ "$field_value" == "0" ]; then echo "字段值已满足条件,执行分组确认" kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge exit 0 @@ -753,7 +753,7 @@ jobs: # 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值 field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers) - if [ "$field_value" == "" ]; then + if [ "$field_value" == "0" ]; then echo "字段值已满足条件,执行分组确认" kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge exit 0 diff --git a/.github/workflows/module_controller_ci_build_batch_symmetric_deploy_to_aliyun.yml b/.github/workflows/module_controller_ci_build_batch_symmetric_deploy_to_aliyun.yml index 3a831315f..af3f184f3 100644 --- a/.github/workflows/module_controller_ci_build_batch_symmetric_deploy_to_aliyun.yml +++ b/.github/workflows/module_controller_ci_build_batch_symmetric_deploy_to_aliyun.yml @@ -167,7 +167,6 @@ jobs: run: | # 定义要等待的资源名称和字段值 moduledeploymentname=$(kubectl get moduledeployment -o name) - desired_field_value=true # 定义等待的超时时间(以秒为单位) timeout_seconds=300 @@ -183,11 +182,11 @@ jobs: fi # 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值 - field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers) + field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers) - if [ "$field_value" == "$desired_field_value" ]; then + if [ "$field_value" == "0" ]; then echo "字段值已满足条件,执行分组确认" - kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge + kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge exit 0 else echo "等待字段值满足条件..." @@ -213,7 +212,6 @@ jobs: run: | # 定义要等待的资源名称和字段值 moduledeploymentname=$(kubectl get moduledeployment -o name) - desired_field_value=true # 定义等待的超时时间(以秒为单位) timeout_seconds=300 @@ -229,11 +227,11 @@ jobs: fi # 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值 - field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers) + field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers) - if [ "$field_value" == "$desired_field_value" ]; then + if [ "$field_value" == "1" ]; then echo "字段值已满足条件,执行分组确认" - kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge + kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":2}}' --type=merge exit 0 else echo "等待字段值满足条件..."