From: Alexandru Avadanii Date: Fri, 22 Feb 2019 14:23:10 +0000 (+0100) Subject: setup-cni: Fix typo, allow absolute exec X-Git-Tag: 1.0.0~43^2 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=6e944bcc019bb4cfb5ccbd9f72f1e9a4a0b3a9a7;hp=d02f2717a3bbdc82ad7443c60edad06855fb4d79;p=iec.git 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 --- 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