Fix 32bit build

This commit is contained in:
Joe Beda
2014-11-21 14:31:40 -08:00
parent 9f5ebef3d8
commit e5b988393d
2 changed files with 29 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ package standalone
import (
"fmt"
"math"
"net"
"net/http"
"os"
@@ -112,9 +113,18 @@ func RunScheduler(cl *client.Client) {
// RunControllerManager starts a controller
func RunControllerManager(machineList []string, cl *client.Client, nodeMilliCPU, nodeMemory int64) {
if int64(int(nodeMilliCPU)) != nodeMilliCPU || int64(int(nodeMemory)) != nodeMemory {
glog.Fatalf("Overflow, nodeCPU or nodeMemory too large for the platform")
if int64(int(nodeMilliCPU)) != nodeMilliCPU {
glog.Warningf("node_milli_cpu is too big for platform. Clamping: %d -> %d",
nodeMilliCPU, math.MaxInt32)
nodeMilliCPU = math.MaxInt32
}
if int64(int(nodeMemory)) != nodeMemory {
glog.Warningf("node_memory is too big for platform. Clamping: %d -> %d",
nodeMemory, math.MaxInt32)
nodeMemory = math.MaxInt32
}
nodeResources := &api.NodeResources{
Capacity: api.ResourceList{
resources.CPU: util.NewIntOrStringFromInt(int(nodeMilliCPU)),