@@ -76,31 +76,6 @@ function os::cleanup::dump_container_logs() {
76
76
}
77
77
readonly -f os::cleanup::dump_container_logs
78
78
79
- # os::cleanup::tmpdir performs cleanup of temp directories as a precondition for running a test. It tries to
80
- # clean up mounts in the temp directories.
81
- #
82
- # Globals:
83
- # - BASETMPDIR
84
- # - USE_SUDO
85
- # Returns:
86
- # None
87
- function os::cleanup::tmpdir() {
88
- # ensure that the directories are clean
89
- if os::util::find::system_binary " findmnt" & > /dev/null; then
90
- for target in $( ${USE_SUDO: +sudo} findmnt --output TARGET --list ) ; do
91
- if [[ " ${target} " == " ${BASETMPDIR} " * ]]; then
92
- ${USE_SUDO: +sudo} umount " ${target} "
93
- fi
94
- done
95
- fi
96
-
97
- # delete any sub directory underneath BASETMPDIR
98
- for directory in $( find " ${BASETMPDIR} " -d 2 ) ; do
99
- ${USE_SUDO: +sudo} rm -rf " ${directory} "
100
- done
101
- }
102
- readonly -f os::cleanup::tmpdir
103
-
104
79
# os::cleanup::internal::list_k8s_containers returns a space-delimited list of
105
80
# docker containers that belonged to k8s.
106
81
#
@@ -122,4 +97,29 @@ function os::cleanup::internal::list_k8s_containers() {
122
97
123
98
echo " ${ids[*]: +" ${ids[*]} " } "
124
99
}
125
- readonly -f os::cleanup::internal::list_k8s_containers
100
+ readonly -f os::cleanup::internal::list_k8s_containers
101
+
102
+ # os::cleanup::tmpdir performs cleanup of temp directories as a precondition for running a test. It tries to
103
+ # clean up mounts in the temp directories.
104
+ #
105
+ # Globals:
106
+ # - BASETMPDIR
107
+ # - USE_SUDO
108
+ # Returns:
109
+ # None
110
+ function os::cleanup::tmpdir() {
111
+ # ensure that the directories are clean
112
+ if os::util::find::system_binary " findmnt" & > /dev/null; then
113
+ for target in $( ${USE_SUDO: +sudo} findmnt --output TARGET --list ) ; do
114
+ if [[ " ${target} " == " ${BASETMPDIR} " * ]]; then
115
+ ${USE_SUDO: +sudo} umount " ${target} "
116
+ fi
117
+ done
118
+ fi
119
+
120
+ # delete any sub directory underneath BASETMPDIR
121
+ for directory in $( find " ${BASETMPDIR} " -d 2 ) ; do
122
+ ${USE_SUDO: +sudo} rm -rf " ${directory} "
123
+ done
124
+ }
125
+ readonly -f os::cleanup::tmpdir
0 commit comments