Skip to content

Commit

Permalink
Merge pull request rancher#27 from crobby/migrationreview23
Browse files Browse the repository at this point in the history
Give the job pod a chance to come up before tailing the log
  • Loading branch information
nflynt committed Aug 16, 2023
2 parents b93e6d0 + 12020af commit edf3535
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cleanup/ad-guid-unmigration.sh
Expand Up @@ -229,7 +229,19 @@ fi
echo "$yaml" | kubectl apply -f -

# Get the pod ID to tail the logs
pod_id=$(kubectl --namespace=cattle-system get pod -l job-name=cattle-cleanup-job -o jsonpath="{.items[0].metadata.name}")
retry_interval=1
max_retries=10
retry_count=0
pod_id=""
while [ $retry_count -lt $max_retries ]; do
pod_id=$(kubectl --namespace=cattle-system get pod -l job-name=cattle-cleanup-job -o jsonpath="{.items[0].metadata.name}")
if [ -n "$pod_id" ]; then
break
else
sleep $retry_interval
((retry_count++))
fi
done

# 600 is equal to 5 minutes, because the sleep interval is 0.5 seconds
job_start_timeout=600
Expand Down

0 comments on commit edf3535

Please sign in to comment.