From 30842bd0cdc017f1098bfe716d7f5576a0514eff Mon Sep 17 00:00:00 2001 From: "r.kuralamudhan" Date: Wed, 6 Nov 2019 22:57:58 -0800 Subject: Optimizing the plugin option in containerized installer Issue-ID: MULTICLOUD-919 Signed-off-by: r.kuralamudhan Change-Id: I6850c2673b1d5e8e7ccc9d036a0a68fa896aa3ab --- kud/hosting_providers/containerized/README.md | 2 +- kud/hosting_providers/containerized/installer.sh | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'kud/hosting_providers/containerized') diff --git a/kud/hosting_providers/containerized/README.md b/kud/hosting_providers/containerized/README.md index 4119ca78..d1659629 100644 --- a/kud/hosting_providers/containerized/README.md +++ b/kud/hosting_providers/containerized/README.md @@ -100,7 +100,7 @@ spec: - name: secret-volume mountPath: "/.ssh" command: ["/bin/sh","-c"] - args: ["cp -r /.ssh /root/; chmod -R 600 /root/.ssh; ./installer --cluster $CLUSTER_NAME"] + args: ["cp -r /.ssh /root/; chmod -R 600 /root/.ssh; ./installer --cluster $CLUSTER_NAME --plugins onap4k8s"] securityContext: privileged: true volumes: diff --git a/kud/hosting_providers/containerized/installer.sh b/kud/hosting_providers/containerized/installer.sh index 60bc6c3a..ad44dc56 100755 --- a/kud/hosting_providers/containerized/installer.sh +++ b/kud/hosting_providers/containerized/installer.sh @@ -20,7 +20,7 @@ function install_prerequisites { apt-get update apt-get install -y curl vim wget git \ software-properties-common python-pip - add-apt-repository ppa:longsleep/golang-backports + add-apt-repository -y ppa:longsleep/golang-backports apt-get update apt-get install -y golang-go rsync } @@ -101,7 +101,7 @@ function install_k8s { # install_addons() - Install Kubenertes AddOns function install_addons { if [ ${1:+1} ]; then - local plugins_name=$1 + local plugins_name="$1" echo "additional addons plugins $1" else local plugins_name="" @@ -116,17 +116,22 @@ function install_addons { ansible-playbook $verbose -i \ $kud_inventory $kud_playbooks/configure-kud.yml | \ tee $cluster_log/setup-kud.log - for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd $plugins_name}; do + for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov $plugins_name}; do echo "Deploying $addon using configure-$addon.yml playbook.." ansible-playbook $verbose -i \ $kud_inventory $kud_playbooks/configure-${addon}.yml | \ tee $cluster_log/setup-${addon}.log - if [[ "${testing_enabled}" == "true" ]]; then + done + + echo "Run the test cases if testing_enabled is set to true." + if [[ "${testing_enabled}" == "true" ]]; then + for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov $plugins_name}; do pushd $kud_tests bash ${addon}.sh popd - fi - done + done + fi + echo "Add-ons deployment complete..." } # install_plugin() - Install ONAP Multicloud Kubernetes plugin @@ -198,7 +203,7 @@ function install_cluster { install_k8s $1 if [ ${2:+1} ]; then echo "install default addons and $2" - install_addons $2 + install_addons "$2" else install_addons fi @@ -275,7 +280,7 @@ if [ "$1" == "--cluster" ]; then exit 1 fi plugins_name=${@:4:$#} - install_cluster $cluster_name $plugins_name + install_cluster $cluster_name "$plugins_name" exit 0 else echo "Error: cluster argument should have plugins; \ -- cgit 1.2.3-korg