mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
Test for and fix crash with nil client in kubelet.
Added test that fails before fix. Fixed use of nil pointer.
This commit is contained in:
@@ -93,7 +93,9 @@ func NewMainKubelet(
|
||||
}
|
||||
|
||||
serviceStore := cache.NewStore()
|
||||
cache.NewReflector(&cache.ListWatch{kubeClient, labels.Everything(), "services", api.NamespaceAll}, &api.Service{}, serviceStore).Run()
|
||||
if kubeClient != nil {
|
||||
cache.NewReflector(&cache.ListWatch{kubeClient, labels.Everything(), "services", api.NamespaceAll}, &api.Service{}, serviceStore).Run()
|
||||
}
|
||||
serviceLister := &cache.StoreToServiceLister{serviceStore}
|
||||
|
||||
klet := &Kubelet{
|
||||
|
Reference in New Issue
Block a user