Skip to content

Commit

Permalink
waiting for registered manifests
Browse files Browse the repository at this point in the history
Signed-off-by: lakshmimsft <[email protected]>
  • Loading branch information
lakshmimsft committed Jan 17, 2025
1 parent 3041cb1 commit 38e1740
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion .github/workflows/functional-test-noncloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ jobs:
mkdir ./bin
cp ./dist/linux_amd64/release/rad ./bin/rad
chmod +x ./bin/rad
export PATH=$GITHUB_WORKSPACE/bin:$PATH
export PATH=$GITHUB_WORKSPACE/bin:$PATH >> $GITHUB_ENV
which rad || { echo "cannot find rad"; exit 1; }
rad bicep download
rad version
Expand Down Expand Up @@ -290,6 +290,50 @@ jobs:
echo "*** Installing Radius to Kubernetes ***"
eval $RAD_COMMAND
- name: Verify manifests are registered
run: |
rm -f registermanifest_logs.txt
# Find the pod with container "ucp"
POD_NAME=$(
kubectl get pods -n radius-system \
-o jsonpath='{range .items[*]}{.metadata.name}{" "}{.spec.containers[*].name}{"\n"}{end}' \
| grep "ucp" \
| head -n1 \
| cut -d" " -f1
)
echo "Found ucp pod: $POD_NAME"
if [ -z "$POD_NAME" ]; then
echo "No pod with container 'ucp' found in namespace radius-system."
exit 1
fi
# Poll logs for up to iterations, 30 seconds each (upto 3 minutes total)
for i in {1..6}; do
kubectl logs "$POD_NAME" -n radius-system | tee registermanifest_logs.txt > /dev/null
# Exit on error
if grep -qi "error" registermanifest_logs.txt; then
echo "Error found in ucp logs."
exit 1
fi
# Check for success
if grep -q "Successfully registered manifests" registermanifest_logs.txt; then
echo "Successfully registered manifests - message found."
break
fi
echo "Logs not ready, waiting 30 seconds..."
sleep 30
done
# Final check to ensure success message was found
if ! grep -q "Successfully registered manifests" registermanifest_logs.txt; then
echo "Manifests not registered after 3 minutes."
exit 1
fi
echo "*** Create workspace, group and environment for test ***"
rad workspace create kubernetes
rad group create kind-radius
Expand Down

0 comments on commit 38e1740

Please sign in to comment.