From 833ef552f5f99f58e4321e7740b3de29912f382a Mon Sep 17 00:00:00 2001 From: Xianglin Gao Date: Fri, 4 Nov 2016 16:56:47 +0800 Subject: [PATCH] skip test docker if we do not use docker as container runtime. Signed-off-by: Xianglin Gao --- hack/local-up-cluster.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 10c370ba5d7..1e045400179 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -130,6 +130,22 @@ function test_docker { fi } +function test_rkt { + if [[ -n "${RKT_PATH}" ]]; then + ${RKT_PATH} list 2> /dev/null 1> /dev/null + if [ "$?" != "0" ]; then + echo "Failed to successfully run 'rkt list', please verify that ${RKT_PATH} is the path of rkt binary." + exit 1 + fi + else + rkt list 2> /dev/null 1> /dev/null + if [ "$?" != "0" ]; then + echo "Failed to successfully run 'rkt list', please verify that rkt is in \$PATH." + exit 1 + fi + fi +} + function test_openssl_installed { openssl version >& /dev/null if [ "$?" != "0" ]; then @@ -477,7 +493,7 @@ function start_kubelet { # dockerized kubelet that might be running. cleanup_dockerized_kubelet cred_bind="" - # path to cloud credentails. + # path to cloud credentials. cloud_cred="" if [ "${CLOUD_PROVIDER}" == "aws" ]; then cloud_cred="${HOME}/.aws/credentials" @@ -609,7 +625,13 @@ EOF fi } -test_docker +if [[ "${CONTAINER_RUNTIME}" == "docker" ]]; then + test_docker +fi + +if [[ "${CONTAINER_RUNTIME}" == "rkt" ]]; then + test_rkt +fi if [[ "${START_MODE}" != "kubeletonly" ]]; then test_apiserver_off