From 071c4d95f28ac00cda1ed5dba9a4bf209b7a66ab Mon Sep 17 00:00:00 2001 From: "Yang (Gabriel) Yu" Date: Mon, 17 Sep 2018 16:17:20 +0800 Subject: bug-fix: kubectl not installed in Bottlenecks docker JIRA: BOTTLENECK-246 Resulting in falure in executing k8s capacity test in Bottlenecks CI Change-Id: Ibf94ccc3d9ce6963ddbc76f8e2168b3a841e347b Signed-off-by: Yang (Gabriel) Yu --- docker/Dockerfile | 2 ++ utils/k8s_setup/k8s_config_pre.sh | 14 ++++++++++++++ utils/k8s_setup/kubectl_install.sh | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c91a60f1..ef63e3b1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -49,5 +49,7 @@ RUN git config --global http.sslVerify false RUN git clone -b $BRANCH https://gerrit.opnfv.org/gerrit/bottlenecks ${BOTTLENECKS_REPO_DIR} RUN git clone https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR} +RUN bash ${BOTTLENECKS_REPO_DIR}/utils/k8s_setup/kubectl_install.sh + RUN pip install -r ${BOTTLENECKS_REPO_DIR}/requirements/requirements.txt RUN pip install -U ${BOTTLENECKS_REPO_DIR} diff --git a/utils/k8s_setup/k8s_config_pre.sh b/utils/k8s_setup/k8s_config_pre.sh index 96f714bf..38e71d23 100644 --- a/utils/k8s_setup/k8s_config_pre.sh +++ b/utils/k8s_setup/k8s_config_pre.sh @@ -64,3 +64,17 @@ if [[ ${INSTALLER_TYPE} == 'compass' ]]; then else echo "BOTTLENECKS EROOR: unrecognized installer" fi + +if [[ -f ${K8S_CONFIG} ]]; then + if [[ -d ~/.kube ]]; then + cp ${K8S_CONFIG} ~/.kube/config + echo "BOTTLENECKS INFO: copying k8s config to ~./kube" + else + mkdir ~/.kube + cp ${K8S_CONFIG} ~/.kube/config + echo "BOTTLENECKS INFO: copying k8s config to ~./kube" + fi +else + echo "BOTTLENECKS ERROR: k8s config file does no exit (${K8S_CONFIG})" + exit 1 +fi diff --git a/utils/k8s_setup/kubectl_install.sh b/utils/k8s_setup/kubectl_install.sh index 14f97f2b..22c6197b 100644 --- a/utils/k8s_setup/kubectl_install.sh +++ b/utils/k8s_setup/kubectl_install.sh @@ -9,7 +9,7 @@ ############################################################################## OS_TYPE=$(uname -a) -OS_UBUNTU=$(echo $OS_TYPE | grep ubuntu) +OS_UBUNTU=$(echo $OS_TYPE | grep Ubuntu) if [[ $OS_UBUNTU ]]; then apt-get update && apt-get install -y apt-transport-https -- cgit 1.2.3-korg