Skip to content

Commit 8a73122

Browse files
committed
Make replica count configurable
1 parent 59bffb0 commit 8a73122

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/wait-deployment.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# $1 is object name, $2 is namespace name, $3 is timeout
2+
# $1 is object name, $2 is namespace name, $3 is desired replica count, $4 is timeout
33

44
printError() {
55
echo "Failed to verify deployment $1. Current replicas is '${CUNNRENT_COUNT}'"
@@ -15,10 +15,11 @@ if [ -z $1 ] || [ -z $2 ]; then
1515
fi
1616
DEPLOYMENT=$1
1717
NAMESPACE=$2
18+
DEFAULT_REQUIRED_COUNT=1
19+
REQUIRED_COUNT=${3:-${DEFAULT_REQUIRED_COUNT}}
1820
DEFAULT_TIMEOUT=300
19-
TIMEOUT=${3:-${DEFAULT_TIMEOUT}}
21+
TIMEOUT=${4:-${DEFAULT_TIMEOUT}}
2022
echo "Waiting for deployment $DEPLOYMENT. Timeout in $TIMEOUT seconds"
21-
REQUIRED_COUNT=1
2223
CUNNRENT_COUNT=$(kubectl get deployment/$DEPLOYMENT -n $NAMESPACE -o=jsonpath='{.status.availableReplicas}')
2324
if [ $? -ne 0 ]; then
2425
echo "An error occurred. Exiting"

0 commit comments

Comments
 (0)