Merge "bug-fix: kubectl not installed in Bottlenecks docker"
authorYang (Gabriel) Yu <Gabriel.yuyang@huawei.com>
Mon, 17 Sep 2018 08:37:18 +0000 (08:37 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 17 Sep 2018 08:37:18 +0000 (08:37 +0000)
docker/Dockerfile
utils/k8s_setup/k8s_config_pre.sh
utils/k8s_setup/kubectl_install.sh

index c91a60f..ef63e3b 100644 (file)
@@ -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}
index 96f714b..38e71d2 100644 (file)
@@ -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
index 14f97f2..22c6197 100644 (file)
@@ -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