From 6e944bcc019bb4cfb5ccbd9f72f1e9a4a0b3a9a7 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 22 Feb 2019 15:23:10 +0100 Subject: [PATCH 1/1] setup-cni: Fix typo, allow absolute exec The `setup-cni.sh` script should be able to run with a different current working directory, so use absolute paths where appropiate. Change-Id: Ic19cbe0c8d1098f8c4a0f547ceeeed442182d28d Signed-off-by: Alexandru Avadanii --- scripts/setup-cni.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/setup-cni.sh b/scripts/setup-cni.sh index c824033..8b9730c 100755 --- a/scripts/setup-cni.sh +++ b/scripts/setup-cni.sh @@ -9,17 +9,19 @@ if [ "$(uname -m)" == 'aarch64' ]; then ETCD_YAML=etcd-arm64.yaml else ETCD_YAML=etcd-amd64.yaml -if +fi -sed -i "s/10.96.232.136/${CLUSTER_IP}/" "cni/calico/${ETCD_YAML}" -kubectl apply -f "cni/calico/${ETCD_YAML}" +SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}") + +sed -i "s/10.96.232.136/${CLUSTER_IP}/" "${SCRIPTS_DIR}/cni/calico/${ETCD_YAML}" +kubectl apply -f "${SCRIPTS_DIR}/cni/calico/${ETCD_YAML}" # Install the RBAC Roles required for Calico -kubectl apply -f "cni/calico/rbac.yaml" +kubectl apply -f "${SCRIPTS_DIR}/cni/calico/rbac.yaml" # Install Calico to system -sed -i "s/10.96.232.136/${CLUSTER_IP}/" cni/calico/calico.yaml -kubectl apply -f cni/calico/calico.yaml +sed -i "s/10.96.232.136/${CLUSTER_IP}/" "${SCRIPTS_DIR}/cni/calico/calico.yaml" +kubectl apply -f "${SCRIPTS_DIR}/cni/calico/calico.yaml" # Remove the taints on master node kubectl taint nodes --all node-role.kubernetes.io/master- || true -- 2.16.6