Skip to content

Commit

Permalink
wait for all pods to get to running state
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kiptoon <[email protected]>
  • Loading branch information
KiptoonKipkurui committed Feb 23, 2024
1 parent 7066b04 commit c383a8c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/e2etests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ jobs:
- name: Start Meshery Server using mesheryctl
run: |
curl -L https://meshery.io/install | ADAPTERS=meshery-istio PLATFORM=kubernetes bash -
# mesheryctl system config minikube
kubectl wait --for=condition=Ready pod --all --all-namespaces --timeout=300s
- name: Run minikube tunnel
run: |
echo 'Running minikube tunnel'
Expand Down Expand Up @@ -109,6 +110,7 @@ jobs:
done
- name: Replace MeshSync
run: |
# sleep 60
# # Set your deployment name, container name, new image version, and new image pull policy
DEPLOYMENT_NAME="meshery-meshsync"
CONTAINER_NAME="meshsync"
Expand All @@ -122,13 +124,12 @@ jobs:
kubectl patch -n meshery deployment meshery-meshsync -p '{"spec":{"template":{"spec":{"containers":[{"name":"meshsync","imagePullPolicy":"IfNotPresent", "image":"meshery-meshsync:test"}]}}}}'
kubectl scale --replicas=1 deployment ${DEPLOYMENT_NAME} -n meshery
kubectl rollout status deployment ${DEPLOYMENT_NAME} -n $NAMESPACE
kubectl get pods -A
# Deploy pod
kubectl run nginx-pod --image=nginx --labels=app=web,tier=frontend,purpose=meshsync-test
# Check Meshery logs
kubectl wait --for=condition=Ready pod --all --all-namespaces --timeout=300s
kubectl get pods -A
mesheryctl system logs meshery
# Check MeshSync logs
mesheryctl system logs meshsync
CLUSTER_ID=$(kubectl get ns kube-system -o jsonpath='{.metadata.uid}')
echo $CLUSTER_ID
Expand All @@ -137,22 +138,20 @@ jobs:
svcip="http://$(kubectl get svc -n meshery | grep "meshery " | tr -s ' ' | cut -d " " -f 3):9081"
echo "this is $svcip"
SECONDS=0
end=$((SECONDS+300))
end=$((SECONDS+420))
while [ $SECONDS -lt $end ]; do
result=$(curl -s --location "${svcip}/api/system/meshsync/resources?kind=Pod&spec=true&annotations=true&labels=true&clusterIds=%5B\"${CLUSTER_ID}\"%5D&page=0&pagesize=25&search=&order=&sort=desc" \
--header "meshery-token: ${{ secrets.PROVIDER_TOKEN }}" \
--header "Cookie: meshery-provider=Meshery; token=${{ secrets.PROVIDER_TOKEN }}" | jq '.resources[].metadata.labels[] | select(.key == "purpose" and .value == "meshsync-test")')
# Check if the variable is empty (no match found)
if [ -n "$result" ]; then
echo "Match found: $result"
break
fi
done
# Check if the loop completed its iterations without finding a match
if [ -z "$result" ]; then
echo "Error: MeshSync unable to discover resources."
exit 1
fi
shell: bash
shell: bash

0 comments on commit c383a8c

Please sign in to comment.