mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-04 10:47:25 +00:00
Fix 32bit build
This commit is contained in:
@@ -22,6 +22,7 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"math"
|
||||
"net"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@@ -50,8 +51,8 @@ var (
|
||||
minionRegexp = flag.String("minion_regexp", "", "If non empty, and -cloud_provider is specified, a regular expression for matching minion VMs.")
|
||||
machineList util.StringList
|
||||
// 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 init() {
|
||||
@@ -89,6 +90,18 @@ func main() {
|
||||
glog.Fatalf("Invalid API configuration: %v", err)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
go http.ListenAndServe(net.JoinHostPort(address.String(), strconv.Itoa(*port)), nil)
|
||||
|
||||
endpoints := service.NewEndpointController(kubeClient)
|
||||
@@ -100,8 +113,8 @@ func main() {
|
||||
cloud := cloudprovider.InitCloudProvider(*cloudProvider, *cloudConfigFile)
|
||||
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(cloud, *minionRegexp, machineList, nodeResources, kubeClient)
|
||||
|
Reference in New Issue
Block a user