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

Commit

Permalink
脚本修复
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-657667 committed Dec 1, 2023
1 parent 28b1cd3 commit 0e09c55
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ jobs:
# 遍历所有Pod进行日志检索
for podname in "${podnames[@]}"; do
log_entry=$(kubectl exec -it $podname -- sh -c 'grep "Install Biz: provider:1.0.2 success" ~/logs/sofa-ark/*.log' 2>/dev/null)
log_entry=$(kubectl exec -it $podname -- sh -c 'grep "Install Biz: provider:1.0.2 success" ~/logs/sofa-ark/*.log || true' 2>/dev/null)
# 如果没有找到日志条目,则将标志设置为false
if [ -z "$log_entry" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,6 @@ jobs:
totalcount=0
# 遍历所有Pod进行日志检索
for podname in "${podnames[@]}"; do
echo "check log Pod: $podname"
kubectl exec -it $podname -- sh -c 'ls -al'
kubectl exec -it $podname -- sh -c 'ls -al ~/'
kubectl exec -it $podname -- sh -c 'ls -al ~/logs'
kubectl exec -it $podname -- sh -c 'ls -al ~/logs/sofa-ark'
log_entry=$(kubectl exec -it $podname -- sh -c 'grep "Install Biz: provider:1.0.2 success" ~/logs/sofa-ark/*.log || true' 2>/dev/null)
echo "totalcount:$totalcount"
if [ -n "$log_entry" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ jobs:
for ((i=0; i<$max_attempts; i++)); do
# 执行您的日志检索命令
log_entry=$(kubectl exec -it $podname -- sh -c 'grep "Install Biz: provider:1.0.2 success" ~/logs/sofa-ark/*.log' 2>/dev/null)
log_entry=$(kubectl exec -it $podname -- sh -c 'grep "Install Biz: provider:1.0.2 success" ~/logs/sofa-ark/*.log || true' 2>/dev/null)
# 如果找到了日志条目,则退出循环
if [ -n "$log_entry" ]; then
Expand Down

0 comments on commit 0e09c55

Please sign in to comment.