Show details of problematic pod in the test
To investigate a problem what some pod is not running easily, this adds the details of the pod when that happens.
This commit is contained in:
parent
2a23f19668
commit
78cc6794c3
1 changed files with 15 additions and 3 deletions
|
@ -44,6 +44,18 @@
|
|||
register: get_pods
|
||||
no_log: true
|
||||
|
||||
- name: Show debugging information when some pods are not ready
|
||||
when: not run_pods_log is success
|
||||
block:
|
||||
- debug: # noqa unnamed-task
|
||||
msg: "{{ get_pods.stdout.split('\n') }}"
|
||||
failed_when: not run_pods_log is success
|
||||
|
||||
- name: Get a not-running pod name
|
||||
command: "{{ bin_dir }}/kubectl get pods --all-namespaces --field-selector=status.phase!=Running --output=jsonpath='{.items[0].metadata.namespace} {.items[0].metadata.name}'"
|
||||
register: problematic_pod
|
||||
no_log: true
|
||||
failed_when: false
|
||||
|
||||
- name: Describe the problematic pod
|
||||
command: "{{ bin_dir }}/kubectl describe pod -n {{ problematic_pod.stdout }}"
|
||||
failed_when: true
|
||||
|
|
Loading…
Reference in a new issue