Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7b7e08

Browse files
lavalampbrendandburns
authored andcommitted
Stop the bleeding for #6059
(cherry picked from commit 6be09c5)
1 parent 02f0bfe commit c7b7e08

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pkg/kubelet/config/apiserver.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ limitations under the License.
1818
package config
1919

2020
import (
21+
"time"
22+
2123
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
2224
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
2325
"github.com/GoogleCloudPlatform/kubernetes/pkg/client/cache"
@@ -40,7 +42,9 @@ func newSourceApiserverFromLW(lw cache.ListerWatcher, updates chan<- interface{}
4042
}
4143
updates <- kubelet.PodUpdate{pods, kubelet.SET, kubelet.ApiserverSource}
4244
}
43-
cache.NewReflector(lw, &api.Pod{}, cache.NewUndeltaStore(send, cache.MetaNamespaceKeyFunc), 0).Run()
45+
// TODO: the 30 second poll loop is here to mitigate #6059 and
46+
// shouldn't be neeeded once that is resolved.
47+
cache.NewReflector(lw, &api.Pod{}, cache.NewUndeltaStore(send, cache.MetaNamespaceKeyFunc), 30*time.Second).Run()
4448
}
4549

4650
func getHostFieldLabel(apiVersion string) string {

plugin/pkg/scheduler/factory/factory.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ func (f *ConfigFactory) CreateFromKeys(predicateKeys, priorityKeys util.StringSe
138138
}
139139

140140
// Watch and queue pods that need scheduling.
141-
cache.NewReflector(f.createUnassignedPodLW(), &api.Pod{}, f.PodQueue, 0).Run()
141+
// TODO: the 30 second poll loop is here to mitigate #6059 and
142+
// shouldn't be neeeded once that is resolved.
143+
cache.NewReflector(f.createUnassignedPodLW(), &api.Pod{}, f.PodQueue, 30*time.Second).Run()
142144

143145
// Pass through all events to the scheduled pod store, but on a deletion,
144146
// also remove from the assumed pods.

0 commit comments

Comments
 (0)