diff --git a/cmd/localkube/localkube.go b/cmd/localkube/localkube.go index b9c3a79ba66..ab65f21dd0a 100644 --- a/cmd/localkube/localkube.go +++ b/cmd/localkube/localkube.go @@ -23,6 +23,7 @@ import ( "flag" "fmt" "log" + "math/rand" "net/http" "os" "time" @@ -90,8 +91,10 @@ func api_server() { Client: http.DefaultClient, Port: *kubelet_port, } + random := rand.New(rand.NewSource(int64(time.Now().Nanosecond()))) + storage := map[string]apiserver.RESTStorage{ - "pods": registry.MakePodRegistryStorage(podRegistry, containerInfo, registry.MakeFirstFitScheduler(machineList, podRegistry)), + "pods": registry.MakePodRegistryStorage(podRegistry, containerInfo, registry.MakeFirstFitScheduler(machineList, podRegistry, random)), "replicationControllers": registry.MakeControllerRegistryStorage(controllerRegistry), "services": registry.MakeServiceRegistryStorage(serviceRegistry), }