Skip to content

Commit 426ce41

Browse files
committed
ci: enhance order-service diagnostics
1 parent 0b02f05 commit 426ce41

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/actions/wait-for-services/action.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,16 @@ runs:
7373
echo "--- order-service container status ---"
7474
kubectl get pods -n "$K8S_NAMESPACE" -l app=order-service -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{range .status.containerStatuses[*]} {.name}: ready={.ready}, restartCount={.restartCount}, state={.state}{"\n"}{end}{range .status.initContainerStatuses[*]} init/{.name}: ready={.ready}, state={.state}{"\n"}{end}{end}' 2>&1 || true
7575
echo ""
76+
echo "--- order-service logs (last 50 lines) ---"
77+
for pod in $(kubectl get pods -n "$K8S_NAMESPACE" -l app=order-service -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do
78+
echo "Pod: ${pod}"
79+
kubectl logs -n "$K8S_NAMESPACE" "$pod" -c order-service --tail=50 2>&1 || true
80+
echo "--- previous container logs ---"
81+
kubectl logs -n "$K8S_NAMESPACE" "$pod" -c order-service --previous --tail=50 2>&1 || true
82+
done
83+
echo ""
7684
echo "--- configmap keys (values redacted) ---"
77-
kubectl get configmap -n "$K8S_NAMESPACE" -l "kustomize.toolkit.fluxcd.io/name" -o jsonpath='{range .items[*]}ConfigMap: {.metadata.name}{"\n"}{range $k, $v := .data} {$k}=***{"\n"}{end}{end}' 2>&1 || true
78-
kubectl get configmap -n "$K8S_NAMESPACE" order-service -o jsonpath='{range $k, $v := .data}{$k}=***{"\n"}{end}' 2>&1 || true
85+
kubectl get configmap -n "$K8S_NAMESPACE" -l app=order-service -o jsonpath='{range .items[*]}ConfigMap: {.metadata.name}{"\n"}{range $k,$v := .data} {$k}=***{"\n"}{end}{end}' 2>&1 || true
7986
echo "::endgroup::"
8087
fi
8188
exit 1

0 commit comments

Comments
 (0)