Skip to content

Commit f4070c7

Browse files
authored
fix(cluster-scanner): Fix generate kubeconfig script to be able handle context name with special characters (#1485)
1 parent bcd6e96 commit f4070c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/cluster-scanner/generate_kubeconfig.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SERVICE_ACCOUNT_NAME=${SERVICE_ACCOUNT_NAME:-sysdig-cluster-scanner}
77
CONTEXT=$(kubectl config current-context)
88
NAMESPACE=${NAMESPACE:-sysdig-cluster-scanner}
99

10-
NEW_CONTEXT=${CLUSTER_NAME_OVERRIDE:-$(kubectl config view --minify -o jsonpath='{.clusters[].name}')}
10+
NEW_CONTEXT=${CLUSTER_NAME_OVERRIDE:-$(kubectl config view --minify -o jsonpath='{.clusters[].name}' | tr :/ -)}
1111
KUBECONFIG_FILE=${KUBECONFIG_FILE:-"${NEW_CONTEXT}.kubeconfig"}
1212

1313
SECRET_NAME=sysdig-cluster-scanner

0 commit comments

Comments
 (0)