From b5a1946ab41c9ffbdd18d08092f1876a34067303 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Fri, 8 Apr 2022 13:04:34 +0200 Subject: [PATCH] added prom2json check in api validation function --- .functions/kubernetes.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.functions/kubernetes.sh b/.functions/kubernetes.sh index 29a4cf0..3138fcc 100644 --- a/.functions/kubernetes.sh +++ b/.functions/kubernetes.sh @@ -58,5 +58,9 @@ function validate_private_ingress(){ function k8s_list_deprecation_apis(){ #Prints all api deprecation warnings in cluster + if ! command -v prom2json > /dev/null; then + printf "You need prom2json for this function: https://github.com/prometheus/prom2json\n" + return 1 + fi kubectl get --raw /metrics | prom2json | jq -c '.[] | select(.name=="apiserver_requested_deprecated_apis").metrics[].labels' | column -t -s'{}[],"' }