Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug fix: Should allow alias range size equals to max number of pods * 2
  • Loading branch information
grayluck committed Jun 27, 2018
1 parent c005b9d commit a806e37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cluster/gce/config-common.sh
Expand Up @@ -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
Expand Down

0 comments on commit a806e37

Please sign in to comment.