From 3442ec480a11d2958491014b3ac0349657acb8ca Mon Sep 17 00:00:00 2001 From: kgeipel Date: Tue, 30 Mar 2021 10:35:29 +0200 Subject: [PATCH 1/2] fixed tls verify parameter and kube api authorization --- kube-dump | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kube-dump b/kube-dump index f2fcb27..1367bac 100755 --- a/kube-dump +++ b/kube-dump @@ -226,7 +226,7 @@ require tar bzip2 [ -n "$kube_context" ] && k_args+=("--context=$kube_context") [ -n "$kube_cluster" ] && k_args+=("--cluster=$kube_cluster") [ "$kube_insecure_tls" == 'true' ] && \ - k_args+=("--insecure-skip-tls-verify=false") + k_args+=("--insecure-skip-tls-verify=true") # Use serviceaccount if [ -n "$KUBERNETES_SERVICE_HOST" ] && \ @@ -239,10 +239,11 @@ then kube_api_token=$( Date: Tue, 30 Mar 2021 10:41:41 +0200 Subject: [PATCH 2/2] prevent globbing and word splitting --- kube-dump | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kube-dump b/kube-dump index 1367bac..7a22c1f 100755 --- a/kube-dump +++ b/kube-dump @@ -243,7 +243,7 @@ then curl --fail --location --output /dev/null --write-out '%{http_code}\n' --cacert $kube_api_ca \ -H "Authorization: Bearer $kube_api_token" --silent "https://$kube_api/livez" ) - if [ $_api_code == "200" ] + if [ "$_api_code" == "200" ] then kubectl config set-cluster "${kube_context:-k8s}" \ --server="https://$kube_api" \