added prom2json check in api validation function

This commit is contained in:
Jonas Forsberg 2022-04-08 13:04:34 +02:00
parent 2750fe86cb
commit b5a1946ab4
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9

View File

@ -58,5 +58,9 @@ function validate_private_ingress(){
function k8s_list_deprecation_apis(){ function k8s_list_deprecation_apis(){
#Prints all api deprecation warnings in cluster #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'{}[],"' kubectl get --raw /metrics | prom2json | jq -c '.[] | select(.name=="apiserver_requested_deprecated_apis").metrics[].labels' | column -t -s'{}[],"'
} }