X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Fshell%2Fk8s_utils.sh;h=b96ec8df6c6bb78120cd261dba67b9dc22d8de05;hp=ac5ecfa287bee32cb1f0283c01c2903e8e0b6569;hb=39957a024d1fff87403aacc34aaaa5a922b6639f;hpb=585bba1465e4fe2e83f6ff702c7db5af4f05d162 diff --git a/resources/libraries/bash/shell/k8s_utils.sh b/resources/libraries/bash/shell/k8s_utils.sh index ac5ecfa287..b96ec8df6c 100644 --- a/resources/libraries/bash/shell/k8s_utils.sh +++ b/resources/libraries/bash/shell/k8s_utils.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2018 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -66,7 +66,8 @@ function k8s_utils.contiv_vpp_deploy { k8s_contiv_patch="kubecon.contiv-vpp-yaml-patch.diff" # Pull the most recent Docker images - bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/pull-images.sh) + url="https://raw.githubusercontent.com/contiv/vpp/master/k8s/pull-images.sh" + bash <(curl -s "${url}") # Apply resources wget ${k8s_contiv} @@ -80,17 +81,21 @@ function k8s_utils.contiv_vpp_deploy { function k8s_utils.cri_shim_install { # Install the CRI Shim on host - sudo su root -c 'bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/cri-install.sh)' + url"https://raw.githubusercontent.com/contiv/vpp/master/k8s/cri-install.sh" + sudo su root -c "bash <(curl -s '${url}')" } function k8s_utils.cri_shim_uninstall { # Uninstall the CRI Shim on host - sudo su root -c 'bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/cri-install.sh) --uninstall' + url="https://raw.githubusercontent.com/contiv/vpp/master/k8s/cri-install.sh" + sudo su root -c "bash <(curl -s '${url}') --uninstall" } function k8s_utils.kube_proxy_install { # Installing custom version of Kube-Proxy to enable Kubernetes services - bash <(curl -s https://raw.githubusercontent.com/contiv/vpp/master/k8s/proxy-install.sh) + url="https://raw.githubusercontent.com/contiv/vpp/master/k8s/" + url+="proxy-install.sh" + bash <(curl -s "${url}") } function k8s_utils.apply { @@ -113,7 +118,9 @@ function k8s_utils.resource_delete { function k8s_utils.affinity_non_vpp { # Set affinity for all non VPP docker containers to CPU 0 - for i in `sudo docker ps --format "{{.ID}} {{.Names}}" | grep -v vpp | cut -d' ' -f1`; do + command='sudo docker ps --format "{{.ID}} {{.Names}}"' + command+=" | grep -v vpp | cut -d' ' -f1" + for i in $(${command}); do sudo docker update --cpuset-cpus 0 ${i} done }