Bug fix: Should allow alias range size equals to max number of pods * 2

pull/8/head
yankaiz 2018-06-27 13:44:50 -07:00
parent c005b9d0ab
commit a806e37851
1 changed files with 2 additions and 2 deletions

View File

@ -99,13 +99,13 @@ function get-cluster-ip-range {
}
# Calculate ip alias range based on max number of pods.
# Let pow be the smallest integer which is bigger than log2($1 * 2).
# Let pow be the smallest integer which is bigger or equal to log2($1 * 2).
# (32 - pow) will be returned.
#
# $1: The number of max pods limitation.
function get-alias-range-size() {
for pow in {0..31}; do
if (( 1 << $pow > $1 * 2 )); then
if (( 1 << $pow >= $1 * 2 )); then
echo $((32 - pow))
return 0
fi