File tree 3 files changed +22
-1
lines changed
3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -152,4 +152,22 @@ function os::cleanup::tmpdir() {
152
152
${USE_SUDO: +sudo} rm -rf " ${directory} "
153
153
done
154
154
}
155
- readonly -f os::cleanup::tmpdir
155
+ readonly -f os::cleanup::tmpdir
156
+
157
+ # os::cleanup::dump_events dumps all the events from a cluster to a file.
158
+ #
159
+ # Globals:
160
+ # ARTIFACT_DIR
161
+ # Arguments:
162
+ # None
163
+ # Returns:
164
+ # None
165
+ function os::cleanup::dump_events() {
166
+ os::log::info " Dumping cluster events to ${ARTIFACT_DIR} /events.txt"
167
+ local kubeconfig
168
+ if [[ -n " ${ADMIN_KUBECONFIG} " ]]; then
169
+ kubeconfig=" --config=${ADMIN_KUBECONFIG} "
170
+ fi
171
+ oc get events --all-namespaces ${kubeconfig} > " ${ARTIFACT_DIR} /events.txt"
172
+ }
173
+ readonly -f os::cleanup::dump_events
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ function cleanup()
39
39
40
40
os::cleanup::dump_etcd
41
41
42
+ os::cleanup::dump_events
43
+
42
44
if [[ -z " ${SKIP_TEARDOWN-} " ]]; then
43
45
os::cleanup::containers
44
46
fi
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ function cleanup_openshift() {
50
50
51
51
if [[ -z " ${SKIP_TEARDOWN-} " ]]; then
52
52
os::cleanup::dump_etcd
53
+ os::cleanup::dump_events
53
54
os::log::info " Tearing down test"
54
55
kill_all_processes
55
56
You can’t perform that action at this time.
0 commit comments