From 25e7c59f877c3f9eece104219f9a72c249f9178f Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Mon, 20 Dec 2021 15:18:47 +0000 Subject: [PATCH] updated kubernetes_api.sh --- kubernetes_api.sh | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/kubernetes_api.sh b/kubernetes_api.sh index 9fcc2f17..e7e99550 100755 --- a/kubernetes_api.sh +++ b/kubernetes_api.sh @@ -33,27 +33,17 @@ usage_description="Auto-determines the Kubernetes API server and kube-system API # shellcheck disable=SC2034 usage_args="/path " -if [ $# -lt 1 ]; then - # shellcheck disable=SC2119 - usage -fi +help_usage "$@" -for x in "$@"; do - # shellcheck disable=SC2119 - case "$x" in - -h|--help) usage - ;; - esac -done +min_args 1 "$@" -check_bin curl +curl_api_opts "$@" token="$(k8s_get_token)" api_server="$(k8s_get_api)" -path="${1:-}" - -shift +path="$1" +shift || : # could also extract the k8s certs from ~/.kube/config (not shown in kubectl config view, would have to json parse outside), and then do # curl "$api_server" --cert encoded.crt --key encoded.key --cacert encoded-ca.crt