forked from rook/rook
we are adding new linter for shellcheck. As we are writing more shell scripts this will help maintain quality. Also, doing all the changes required in bash files to pass this shellcheck. Closes: https://github.com/rook/rook/issues/8431 Signed-off-by: subhamkrai <srai@redhat.com>
20 lines
521 B
Bash
Executable File
20 lines
521 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
BASE_DIR=$(cd "$(dirname "$0")" && pwd)
|
|
|
|
if [ -z "$KUBECONFIG" ];then
|
|
if [ -f "$HOME/.kube/config" ]; then
|
|
export KUBECONFIG="$HOME/.kube/config"
|
|
else
|
|
sudo cp /etc/kubernetes/admin.conf "$HOME"/
|
|
sudo chown "$(id -u)":"$(id -g)" "$HOME"/admin.conf
|
|
export KUBECONFIG=$HOME/admin.conf
|
|
fi
|
|
fi
|
|
|
|
if [ -f "${BASE_DIR}"/deploy_admission_controller.sh ];then
|
|
bash "${BASE_DIR}"/deploy_admission_controller.sh
|
|
else
|
|
echo "${BASE_DIR}/deploy_admission_controller.sh not found !"
|
|
fi
|