Skip to content

Commit 52fe401

Browse files
k8s gha: Fix logging check application step (DefectDojo#4381)
1 parent e1691cb commit 52fe401

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/k8s-testing.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,15 @@ jobs:
181181
- name: Check Application
182182
run: |-
183183
to_complete () {
184-
kubectl wait --for=$1 $2 --timeout=500s --selector=$3
185-
if [[ ${?} != 0 ]]; then
184+
kubectl wait --for=$1 $2 --timeout=500s --selector=$3 2>/tmp/test || true
185+
if [[ -s /tmp/test ]]; then
186186
echo "ERROR: $2"
187+
cat /tmp/test
187188
echo "INFO: status:"
188189
kubectl get pods
189190
echo "INFO: logs:"
190-
kubectl logs --selector=$3
191+
kubectl logs --selector=$3 --all-containers=true
192+
exit 1
191193
fi
192194
return ${?}
193195
}

0 commit comments

Comments
 (0)