Skip to content

Commit

Permalink
fixed extra space in messages when KUBECTL_ARGS is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
groundnuty committed May 30, 2018
1 parent 8626df8 commit c747a52
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wait_for.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,18 @@ wait_for_resource() {
wait_for_resource_type=$1
wait_for_resource_descriptor="$2"
while [ -n "$(get_${wait_for_resource_type}_state "$wait_for_resource_descriptor")" ] ; do
echo "Waiting for $wait_for_resource_type $wait_for_resource_descriptor $KUBECTL_ARGS..."
print_KUBECTL_ARGS="$KUBECTL_ARGS"
[ "$print_KUBECTL_ARGS" != "" ] && print_KUBECTL_ARGS=" $print_KUBECTL_ARGS"
echo "Waiting for $wait_for_resource_type $wait_for_resource_descriptor${print_KUBECTL_ARGS}..."
sleep "$WAIT_TIME"
done
ready "$wait_for_resource_type" "$wait_for_resource_descriptor"
}

ready() {
printf "[%s] %s %s %s is ready." "$(date +'%Y-%m-%d %H:%M:%S')\\n" "$1" "$2" "$KUBECTL_ARGS"
print_KUBECTL_ARGS="$KUBECTL_ARGS"
[ "$print_KUBECTL_ARGS" != "" ] && print_KUBECTL_ARGS=" $print_KUBECTL_ARGS"
printf "[%s] %s %s%s is ready.\\n" "$(date +'%Y-%m-%d %H:%M:%S')" "$1" "$2" "$print_KUBECTL_ARGS"
}

main() {
Expand Down

0 comments on commit c747a52

Please sign in to comment.