From 83057603dd9740240992f3f39ee79584d638df06 Mon Sep 17 00:00:00 2001 From: Marat Salakhutdinov Date: Fri, 17 Nov 2023 10:36:01 -0500 Subject: [PATCH] replace : and / in context name for kubeconfig file name --- scripts/cluster-scanner/generate_kubeconfig.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cluster-scanner/generate_kubeconfig.sh b/scripts/cluster-scanner/generate_kubeconfig.sh index d386fbc28..1039950e1 100644 --- a/scripts/cluster-scanner/generate_kubeconfig.sh +++ b/scripts/cluster-scanner/generate_kubeconfig.sh @@ -7,7 +7,7 @@ SERVICE_ACCOUNT_NAME=${SERVICE_ACCOUNT_NAME:-sysdig-cluster-scanner} CONTEXT=$(kubectl config current-context) NAMESPACE=${NAMESPACE:-sysdig-cluster-scanner} -NEW_CONTEXT=${CLUSTER_NAME_OVERRIDE:-$(kubectl config view --minify -o jsonpath='{.clusters[].name}')} +NEW_CONTEXT=${CLUSTER_NAME_OVERRIDE:-$(kubectl config view --minify -o jsonpath='{.clusters[].name}' | tr :/ -)} KUBECONFIG_FILE=${KUBECONFIG_FILE:-"${NEW_CONTEXT}.kubeconfig"} SECRET_NAME=sysdig-cluster-scanner