Skip to content

Commit

Permalink
add check to verify manifests are registered
Browse files Browse the repository at this point in the history
Signed-off-by: lakshmimsft <[email protected]>
  • Loading branch information
lakshmimsft committed Jan 24, 2025
1 parent db3bc86 commit e80e04c
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,51 @@ jobs:
else
rad install kubernetes --set rp.publicEndpointOverride=localhost
fi
echo "*** Verify manifests are registered ***"
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 "Service initializer terminated with error" registermanifest_logs.txt; then
echo "Error found in ucp logs."
grep -i "Service initializer terminated with error" registermanifest_logs.txt
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
rad group create default
rad workspace create kubernetes default --group default
rad group switch default
Expand Down

0 comments on commit e80e04c

Please sign in to comment.