Remove redundant kubelet dependency of executor
This commit is contained in:
@@ -368,17 +368,28 @@ func (ks *KubeletExecutorServer) createAndInitKubelet(
|
||||
kubeletFinished := make(chan struct{})
|
||||
staticPodsConfigPath := filepath.Join(kc.RootDirectory, "static-pods")
|
||||
exec := executor.New(executor.Config{
|
||||
Kubelet: klet,
|
||||
Updates: updates,
|
||||
SourceName: MESOS_CFG_SOURCE,
|
||||
APIClient: kc.KubeClient,
|
||||
Docker: kc.DockerClient,
|
||||
SuicideTimeout: ks.SuicideTimeout,
|
||||
Updates: updates,
|
||||
SourceName: MESOS_CFG_SOURCE,
|
||||
APIClient: kc.KubeClient,
|
||||
Docker: kc.DockerClient,
|
||||
SuicideTimeout: ks.SuicideTimeout,
|
||||
LaunchGracePeriod: ks.LaunchGracePeriod,
|
||||
KubeletFinished: kubeletFinished,
|
||||
ExitFunc: os.Exit,
|
||||
PodStatusFunc: func(_ executor.KubeletInterface, pod *api.Pod) (*api.PodStatus, error) {
|
||||
return klet.GetRuntime().GetPodStatus(pod)
|
||||
KubeletFinished: kubeletFinished,
|
||||
ExitFunc: os.Exit,
|
||||
PodStatusFunc: func(pod *api.Pod) (*api.PodStatus, error) {
|
||||
status, err := klet.GetRuntime().GetPodStatus(pod)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
status.Phase = kubelet.GetPhase(&pod.Spec, status.ContainerStatuses)
|
||||
hostIP, err := klet.GetHostIP()
|
||||
if err != nil {
|
||||
log.Errorf("Cannot get host IP: %v", err)
|
||||
} else {
|
||||
status.HostIP = hostIP.String()
|
||||
}
|
||||
return status, nil
|
||||
},
|
||||
StaticPodsConfigPath: staticPodsConfigPath,
|
||||
PodLW: cache.NewListWatchFromClient(kc.KubeClient, "pods", api.NamespaceAll, fields.OneTermEqualSelector(client.PodHost, kc.NodeName)),
|
||||
|
Reference in New Issue
Block a user