From e0ec910ecc9f14029a076eb222fcfc367c39ae10 Mon Sep 17 00:00:00 2001 From: Sam Yuan Date: Tue, 12 Mar 2024 22:18:01 +0800 Subject: [PATCH] replace home dir with project root Signed-off-by: Sam Yuan --- main.sh | 2 +- providers/kind/kind.sh | 1 + verify.sh | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.sh b/main.sh index fa1434c..eab4836 100755 --- a/main.sh +++ b/main.sh @@ -44,7 +44,7 @@ declare -r PROJECT_ROOT CALLER_PROJECT_ROOT # configuration declare -r CTR_CMD=${CTR_CMD:-docker} declare -r CLUSTER_PROVIDER=${CLUSTER_PROVIDER:-kind} -declare -r KUBECONFIG_ROOT_DIR=${KUBECONFIG_ROOT_DIR:-$HOME/.kube} +declare -r KUBECONFIG_ROOT_DIR=${KUBECONFIG_ROOT_DIR:-$PROJECT_ROOT/.kube} declare -r KEPLER_KUBECONFIG=${KEPLER_KUBECONFIG:-config-kepler} declare -r REGISTRY_PORT=${REGISTRY_PORT:-5001} diff --git a/providers/kind/kind.sh b/providers/kind/kind.sh index b307ff9..7c7ce1c 100755 --- a/providers/kind/kind.sh +++ b/providers/kind/kind.sh @@ -131,6 +131,7 @@ kind_up() { kind_preinstall_check _prepare_config _setup_kind + export KUBECONFIG="$KIND_KUBECONFIG" wait_for_cluster_ready kind_wait_up _run_kind_registry diff --git a/verify.sh b/verify.sh index 6ad1a4b..3a9dd64 100755 --- a/verify.sh +++ b/verify.sh @@ -20,6 +20,7 @@ set -eu -o pipefail PROJECT_ROOT="$(git rev-parse --show-toplevel)" declare -r PROJECT_ROOT +declare -r KUBECONFIG_ROOT_DIR=${KUBECONFIG_ROOT_DIR:-$PROJECT_ROOT/.kube} # shellcheck source=lib/utils.sh source "$PROJECT_ROOT/lib/utils.sh" @@ -43,7 +44,7 @@ verify_bcc() { verify_cluster() { # basic check for k8s cluster info info "Verifying cluster status" - + export KUBECONFIG="${KUBECONFIG_ROOT_DIR}/config" run kubectl cluster-info || die "failed to get the cluster-info" # check k8s system pod is there...