added NV CVE db version function
This commit is contained in:
parent
13c81c09da
commit
63448ef3b9
@ -64,3 +64,14 @@ function k8s_list_deprecation_apis(){
|
|||||||
fi
|
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'{}[],"'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function neuvector_cve_db_version(){
|
||||||
|
local NAMESPACE="cattle-neuvector-system"
|
||||||
|
|
||||||
|
printf "%-40s %s\n" "Pod" "CVE DB version"
|
||||||
|
|
||||||
|
for POD in $(kubectl -n $NAMESPACE get pods -l 'app=neuvector-scanner-pod' --template "{{range .items}}{{.metadata.name}}{{\"\n\"}}{{end}}"); do
|
||||||
|
version="$(kubectl -n "$NAMESPACE" logs "$POD" | grep "Expand new DB" | tail -1 | sed -n 's/.*Expand new DB - version=\([0-9]*\.[0-9]*\)/\1/p')"
|
||||||
|
printf "%-40s %s\n" "$POD" "$version"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user