File tree Expand file tree Collapse file tree
infrastructure/scripts/spring-ai Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,12 +40,18 @@ kubectl rollout restart deployment unicorn-spring-ai-agent -n unicorn-spring-ai-
4040echo " Waiting for pods to be ready..."
4141kubectl rollout status deployment unicorn-spring-ai-agent -n unicorn-spring-ai-agent --timeout=300s
4242
43- # Get the pod name
44- POD_NAME=$( kubectl get pods -n unicorn-spring-ai-agent -l app=unicorn-spring-ai-agent -o jsonpath=' {.items[0].metadata.name}' )
43+ # Get the name of a running pod
44+ echo " Finding running pod..."
45+ POD_NAME=$( kubectl get pods -n unicorn-spring-ai-agent -l app=unicorn-spring-ai-agent --field-selector=status.phase=Running -o jsonpath=' {.items[0].metadata.name}' )
4546if [ -z " $POD_NAME " ]; then
46- echo " Error: Could not find pod. Exiting."
47- exit 1
47+ echo " Error: Could not find running pod. Retrying with any pod status..."
48+ POD_NAME=$( kubectl get pods -n unicorn-spring-ai-agent -l app=unicorn-spring-ai-agent -o jsonpath=' {.items[0].metadata.name}' )
49+ if [ -z " $POD_NAME " ]; then
50+ echo " Error: Could not find any pod. Exiting."
51+ exit 1
52+ fi
4853fi
54+ echo " Found pod: $POD_NAME "
4955
5056# Show logs
5157echo " Showing logs from pod $POD_NAME ..."
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ spec:
103103 initialDelaySeconds: 10
104104 startupProbe:
105105 httpGet:
106- path: /
106+ path: /actuator/health
107107 port: 8080
108108 failureThreshold: 6
109109 periodSeconds: 5
You can’t perform that action at this time.
0 commit comments