Kubelet should have a max think time before auto resync

The sync frequency should be part of the syncLoop and resync no
less often than every X seconds.  The current implementation runs
even if a config update was delivered less than X seconds ago.
This commit is contained in:
Clayton Coleman
2014-08-06 16:12:19 -04:00
parent b43e3865b4
commit d7f46718a8
3 changed files with 21 additions and 20 deletions

View File

@@ -115,7 +115,6 @@ func startComponents(manifestURL string) (apiServerURL string) {
config.NewSourceURL(manifestURL, 5*time.Second, cfg1.Channel("url"))
myKubelet := kubelet.NewIntegrationTestKubelet(machineList[0], &fakeDocker1)
go util.Forever(func() { myKubelet.Run(cfg1.Updates()) }, 0)
go util.Forever(cfg1.Sync, 3*time.Second)
go util.Forever(func() {
kubelet.ListenAndServeKubeletServer(myKubelet, cfg1.Channel("http"), http.DefaultServeMux, "localhost", 10250)
}, 0)
@@ -127,7 +126,6 @@ func startComponents(manifestURL string) (apiServerURL string) {
config.NewSourceEtcd(config.EtcdKeyForHost(machineList[1]), etcdClient, 30*time.Second, cfg2.Channel("etcd"))
otherKubelet := kubelet.NewIntegrationTestKubelet(machineList[1], &fakeDocker2)
go util.Forever(func() { otherKubelet.Run(cfg2.Updates()) }, 0)
go util.Forever(cfg2.Sync, 3*time.Second)
go util.Forever(func() {
kubelet.ListenAndServeKubeletServer(otherKubelet, cfg2.Channel("http"), http.DefaultServeMux, "localhost", 10251)
}, 0)