From 6d5c782fce0009d265e6ea115ed83f6bf2e415ce Mon Sep 17 00:00:00 2001 From: Graham Whaley Date: Fri, 23 Aug 2019 10:53:46 +0100 Subject: [PATCH] metrics: scaling: check we have `bc` installed We now use `bc` for some of the stats calculations. Ensure it is installed, or we silently generate bad field data. Signed-off-by: Graham Whaley --- metrics/scaling/k8s_scale.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/metrics/scaling/k8s_scale.sh b/metrics/scaling/k8s_scale.sh index 03f425d..0561e0c 100755 --- a/metrics/scaling/k8s_scale.sh +++ b/metrics/scaling/k8s_scale.sh @@ -199,6 +199,10 @@ EOF init() { info "Initialising" + + local cmds=("bc") + check_cmds "${cmds[@]}" + info "Checking k8s accessible" local worked=$( kubectl get nodes > /dev/null 2>&1 && echo $? || echo $? ) if [ "$worked" != 0 ]; then