From ffcdb9dfb756bb926e62892b4053337258db1edb Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 11 Nov 2014 09:10:45 -0800 Subject: [PATCH] Fix build on 32 bit processors. --- cmd/kubernetes/kubernetes.go | 4 ++-- pkg/standalone/standalone.go | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/kubernetes/kubernetes.go b/cmd/kubernetes/kubernetes.go index 5dc5e108077..0e7c83f3a97 100644 --- a/cmd/kubernetes/kubernetes.go +++ b/cmd/kubernetes/kubernetes.go @@ -40,8 +40,8 @@ var ( dockerEndpoint = flag.String("docker_endpoint", "", "If non-empty, use this for the docker endpoint to communicate with") etcdServer = flag.String("etcd_server", "http://localhost:4001", "If non-empty, path to the set of etcd server to use") // TODO: Discover these by pinging the host machines, and rip out these flags. - nodeMilliCPU = flag.Int("node_milli_cpu", 1000, "The amount of MilliCPU provisioned on each node") - nodeMemory = flag.Int("node_memory", 3*1024*1024*1024, "The amount of memory (in bytes) provisioned on each node") + nodeMilliCPU = flag.Int64("node_milli_cpu", 1000, "The amount of MilliCPU provisioned on each node") + nodeMemory = flag.Int64("node_memory", 3*1024*1024*1024, "The amount of memory (in bytes) provisioned on each node") ) func startComponents(etcdClient tools.EtcdClient, cl *client.Client, addr string, port int) { diff --git a/pkg/standalone/standalone.go b/pkg/standalone/standalone.go index 7225478e580..c1e99f9f673 100644 --- a/pkg/standalone/standalone.go +++ b/pkg/standalone/standalone.go @@ -114,11 +114,14 @@ func RunScheduler(cl *client.Client) { } // RunControllerManager starts a controller -func RunControllerManager(machineList []string, cl *client.Client, nodeMilliCPU, nodeMemory int) { +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") + } nodeResources := &api.NodeResources{ Capacity: api.ResourceList{ - resources.CPU: util.NewIntOrStringFromInt(nodeMilliCPU), - resources.Memory: util.NewIntOrStringFromInt(nodeMemory), + resources.CPU: util.NewIntOrStringFromInt(int(nodeMilliCPU)), + resources.Memory: util.NewIntOrStringFromInt(int(nodeMemory)), }, } minionController := minionControllerPkg.NewMinionController(nil, "", machineList, nodeResources, cl)