Update style of temp dir cleanup function
The function was in the middle of other internal functions, so it was
moved for readability. Indentation was changed to tabs and made to be
consistent.
@@ -76,6 +76,29 @@ function os::cleanup::dump_container_logs() {
}
readonly -f os::cleanup::dump_container_logs
+# os::cleanup::internal::list_k8s_containers returns a space-delimited list of
+# docker containers that belonged to k8s.
+#
+# Globals:
+# None
+# Arguments:
+# None
+# Returns:
+# None
+function os::cleanup::internal::list_k8s_containers() {
+ local ids;
+ for short_id in $( docker ps -aq ); do
+ local id; id="$( docker inspect --format '{{ .Id }}' "${short_id}" )"
+ local name; name="$( docker inspect --format '{{ .Name }}' "${id}" )"
+ if [[ "${name}" =~ ^/k8s_.* ]]; then
+ ids+=( "${id}" )
+ fi
+ done
+
+ echo "${ids[*]:+"${ids[*]}"}"
+}
+readonly -f os::cleanup::internal::list_k8s_containers
+
# os::cleanup::tmpdir performs cleanup of temp directories as a precondition for running a test. It tries to
# clean up mounts in the temp directories.
#
@@ -100,26 +123,3 @@ function os::cleanup::tmpdir() {
done
}
readonly -f os::cleanup::tmpdir
\ No newline at end of file
-
-# os::cleanup::internal::list_k8s_containers returns a space-delimited list of
-# docker containers that belonged to k8s.
-#
-# Globals:
-# None
-# Arguments:
-# None
-# Returns:
-# None
-function os::cleanup::internal::list_k8s_containers() {
- local ids;
- for short_id in $( docker ps -aq ); do
- local id; id="$( docker inspect --format '{{ .Id }}' "${short_id}" )"
- local name; name="$( docker inspect --format '{{ .Name }}' "${id}" )"
- if [[ "${name}" =~ ^/k8s_.* ]]; then
- ids+=( "${id}" )
- fi
- done
-
- echo "${ids[*]:+"${ids[*]}"}"
-}
-readonly -f os::cleanup::internal::list_k8s_containers
\ No newline at end of file
