Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
ci test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-657667 committed Jan 17, 2024
1 parent 8537718 commit 302fde1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers)
if [ "$field_value" == "<none>" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge
exit 0
Expand Down Expand Up @@ -368,7 +368,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers)
if [ "$field_value" == "<none>" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge
exit 0
Expand Down Expand Up @@ -509,7 +509,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers)
if [ "$field_value" == "<none>" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge
exit 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers)
if [ "$field_value" == "<none>" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge
exit 0
Expand Down Expand Up @@ -595,7 +595,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers)
if [ "$field_value" == "<none>" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge
exit 0
Expand Down Expand Up @@ -753,7 +753,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers)
if [ "$field_value" == "<none>" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge
exit 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ jobs:
run: |
# 定义要等待的资源名称和字段值
moduledeploymentname=$(kubectl get moduledeployment -o name)
desired_field_value=true
# 定义等待的超时时间(以秒为单位)
timeout_seconds=300
Expand All @@ -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 "等待字段值满足条件..."
Expand All @@ -213,7 +212,6 @@ jobs:
run: |
# 定义要等待的资源名称和字段值
moduledeploymentname=$(kubectl get moduledeployment -o name)
desired_field_value=true
# 定义等待的超时时间(以秒为单位)
timeout_seconds=300
Expand All @@ -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 "等待字段值满足条件..."
Expand Down

0 comments on commit 302fde1

Please sign in to comment.