Skip to content

Commit d6dd3d9

Browse files
authored
Merge pull request #36 from MoBlockbuster/SHOW-VERSION
Show current version of local check_kubernetes.sh to compare it with …
2 parents 028b3cc + 58b058d commit d6dd3d9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

check_kubernetes.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
usage() {
1313
cat <<- EOF
1414
Usage $0 [-m <MODE>|-h] [-o <TIMEOUT>] [-H <APISERVER> [-T <TOKEN>|-t <TOKENFILE>]] [-K <KUBE_CONFIG>]
15-
[-N <NAMESPACE>] [-n <NAME>] [-w <WARN>] [-c <CRIT>]
15+
[-N <NAMESPACE>] [-n <NAME>] [-w <WARN>] [-c <CRIT>] [-v]
1616
1717
Options are:
1818
-m MODE Which check to perform
@@ -36,6 +36,7 @@ usage() {
3636
- Pvc storage utilization; default is 90%
3737
- API cert expiration days for apicert mode; default is 15
3838
-M EXIT_CODE Exit code when resource is missing; default is 2 (CRITICAL)
39+
-v Show current Version
3940
-h Show this help and exit
4041
4142
Modes are:
@@ -56,6 +57,8 @@ usage() {
5657
exit 2
5758
}
5859

60+
VERSION="v1.3.1"
61+
5962
TIMEOUT=15
6063
unset NAME
6164

@@ -64,7 +67,7 @@ die() {
6467
exit "${2:-2}"
6568
}
6669

67-
while getopts ":m:M:H:T:t:K:N:n:o:c:w:h" arg; do
70+
while getopts ":m:M:H:T:t:K:N:n:o:c:w:h:v" arg; do
6871
case $arg in
6972
h) usage ;;
7073
m) MODE="$OPTARG" ;;
@@ -78,6 +81,7 @@ while getopts ":m:M:H:T:t:K:N:n:o:c:w:h" arg; do
7881
n) NAME="$OPTARG" ;;
7982
w) WARN="$OPTARG" ;;
8083
c) CRIT="$OPTARG" ;;
84+
v) echo "check_kubernetes.sh Version: $VERSION" && exit 0 ;;
8185
*) usage ;;
8286
esac
8387
done

0 commit comments

Comments
 (0)