Skip to content

Commit 710645f

Browse files
committed
ci: capture all node restart related errors
1 parent bd5f74a commit 710645f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e-step-template.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,27 @@ steps:
124124
- ${{ if eq( parameters['testHubble'], true) }}:
125125
- ${{if eq( parameters['nightly'], true) }}:
126126
- script: |
127-
set -e
128127
echo "Check Cilium Connectivity Test Logs before Daemonset restart"
129128
cilium status
130129
cilium connectivity test --test check-log-errors --log-check-levels error > output.log
130+
# Capture the exit code from connectivity test
131+
exitCode=$?
131132
cat output.log
132133
134+
# Node Restart is expected to cause "Non-zero (1)" in cilium agent logs and
135+
# a missing init container i.e. "install-cni-binaries in pod "cilium-fmjsb" not found"
133136
if grep -q "Non-zero (1)" output.log; then
134137
echo "Expected error log from Node Restart, proceed."
135138
echo "Check for additional errors."
136-
if grep -v "Non-zero (1)" output.log | grep "check-log-errors" | grep "Error"; then
139+
140+
# Check for any other errors aside from node restart
141+
if grep -v "Non-zero (1)" output.log | grep -v "previous terminated container" | grep "check-log-errors" | grep "Error"; then
137142
echo "##[error]Unexpected errors found in Cilium connectivity test logs"
138143
fi
144+
elif [ $exitCode -ne 0 ]; then
145+
echo "##[error]Unexpected errors found in Cilium connectivity test logs"
146+
else
147+
echo "Unexpected, Node restart should always cause exitCode == 1 from cilium connectivity test"
139148
fi
140149
echo "No errors found in Cilium connectivity test logs before Daemonset restart"
141150
name: "ciliumConnectivityLogs"

0 commit comments

Comments
 (0)