Improve debug output for K8s tests when the pod fails to start #5171
Labels
Team:Elastic-Agent
Label for the Agent team
Team:Elastic-Agent-Control-Plane
Label for the Agent Control Plane team
Team:Security-Deployment and Devices
Testing
Describe the enhancement:
When a pod fails to start we need to request the most recent logs the pod had before dying.
That would be an equivalent of:
kubectl logs --previous -f --namespace=kube-system $(kubectl get pods --all-namespaces --output=json | jq '.items[].metadata.name' -r | grep elastic-agent)
Describe a specific use case for the enhancement or feature:
Sometimes changes in a Dockerfile lead to a broken entry point for the container, in this case we need to catch the errors of the entry point.
What is the definition of done?
When the container/pod crashes or fails to start we should have an output of the most recent logs as a result of the failed K8s test.
The text was updated successfully, but these errors were encountered: