|
@@ -15,23 +15,11 @@ for type in "${types[@]}"; do
|
|
|
fi
|
|
|
done
|
|
|
|
|
|
-# TODO: move to cri-ctl
|
|
|
-# TODO: short term hack for cri-o
|
|
|
-
|
|
|
-# Get a child container name to wait for it to stop
|
|
|
-child_container=$(docker ps -l -q --filter "label=io.kubernetes.container.name=${1}")
|
|
|
-
|
|
|
-container=$(docker ps -l -q --filter "label=openshift.io/component=${1}" --filter "label=io.kubernetes.container.name=POD")
|
|
|
-if [[ -z "${container}" ]]; then
|
|
|
+pod=$(crictl pods -l -q --label "openshift.io/component=${1}" --label "io.kubernetes.container.name=POD 2>/dev/null")
|
|
|
+if [[ -z "${pod}" ]]; then
|
|
|
echo "Component ${1} is already stopped" 1>&2
|
|
|
exit 0
|
|
|
fi
|
|
|
# Stop the pod
|
|
|
-docker stop "${container}" --time 30 >/dev/null
|
|
|
-
|
|
|
-# Wait for child container to change state
|
|
|
-if [[ -z "${child_container}" ]]; then
|
|
|
- echo "Component ${1} is already stopped" 1>&2
|
|
|
- exit 0
|
|
|
-fi
|
|
|
-exec timeout 60 docker wait $child_container
|
|
|
+# TODO(runcom): expose timeout in the CRI
|
|
|
+crictl stopp "${pod}" >/dev/null
|