Fix bash substring for older bash

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
Marcus Noble 2021-12-08 08:22:05 +00:00
parent 927cf87bae
commit 1dfe84005b
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78

View File

@ -52,7 +52,7 @@ fi
NAMES="$(kubectl api-resources --namespaced --verbs list -o name | tr '\n' ,)"
if [ $ALL_NAMESPACES ]; then
kubectl get "${NAMES:0:-1}" --show-kind --ignore-not-found ${LABEL} -A
kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -A
else
kubectl get "${NAMES:0:-1}" --show-kind --ignore-not-found ${LABEL} -n ${NAMESPACE}
kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -n ${NAMESPACE}
fi