mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Fix a bug of running node selector predicate on kubelet introduced by #5715.
part of #5207, and fixed #5810
This commit is contained in:
parent
bc4a082f7a
commit
e2e1d9e943
@ -166,7 +166,7 @@ func NewMainKubelet(
|
|||||||
}
|
}
|
||||||
serviceLister := &cache.StoreToServiceLister{serviceStore}
|
serviceLister := &cache.StoreToServiceLister{serviceStore}
|
||||||
|
|
||||||
serviceStore = cache.NewStore(cache.MetaNamespaceKeyFunc)
|
nodeStore := cache.NewStore(cache.MetaNamespaceKeyFunc)
|
||||||
if kubeClient != nil {
|
if kubeClient != nil {
|
||||||
// TODO: cache.NewListWatchFromClient is limited as it takes a client implementation rather
|
// TODO: cache.NewListWatchFromClient is limited as it takes a client implementation rather
|
||||||
// than an interface. There is no way to construct a list+watcher using resource name.
|
// than an interface. There is no way to construct a list+watcher using resource name.
|
||||||
@ -183,9 +183,9 @@ func NewMainKubelet(
|
|||||||
labels.Everything(), fields.Everything(), resourceVersion)
|
labels.Everything(), fields.Everything(), resourceVersion)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
cache.NewReflector(listWatch, &api.Service{}, serviceStore, 0).Run()
|
cache.NewReflector(listWatch, &api.Node{}, nodeStore, 0).Run()
|
||||||
}
|
}
|
||||||
nodeLister := &cache.StoreToNodeLister{serviceStore}
|
nodeLister := &cache.StoreToNodeLister{nodeStore}
|
||||||
|
|
||||||
containerGC, err := newContainerGC(dockerClient, containerGCPolicy)
|
containerGC, err := newContainerGC(dockerClient, containerGCPolicy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user