Merge pull request #14270 from mesosphere/sttts-cleanup-executor-events

MESOS: Remove unused Watch code in executor
This commit is contained in:
Brian Grant 2015-09-25 13:27:12 -07:00
commit 95d4c70a5d

View File

@ -42,7 +42,6 @@ import (
"k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/dockertools" "k8s.io/kubernetes/pkg/kubelet/dockertools"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/watch"
) )
const ( const (
@ -109,7 +108,6 @@ type KubernetesExecutor struct {
lock sync.RWMutex lock sync.RWMutex
sourcename string sourcename string
client *client.Client client *client.Client
events <-chan watch.Event
done chan struct{} // signals shutdown done chan struct{} // signals shutdown
outgoing chan func() (mesos.Status, error) // outgoing queue to the mesos driver outgoing chan func() (mesos.Status, error) // outgoing queue to the mesos driver
dockerClient dockertools.DockerInterface dockerClient dockertools.DockerInterface
@ -131,7 +129,6 @@ type Config struct {
Updates chan<- interface{} // to send pod config updates to the kubelet Updates chan<- interface{} // to send pod config updates to the kubelet
SourceName string SourceName string
APIClient *client.Client APIClient *client.Client
Watch watch.Interface
Docker dockertools.DockerInterface Docker dockertools.DockerInterface
ShutdownAlert func() ShutdownAlert func()
SuicideTimeout time.Duration SuicideTimeout time.Duration
@ -169,20 +166,6 @@ func New(config Config) *KubernetesExecutor {
staticPodsConfigPath: config.StaticPodsConfigPath, staticPodsConfigPath: config.StaticPodsConfigPath,
} }
//TODO(jdef) do something real with these events..
if config.Watch != nil {
events := config.Watch.ResultChan()
if events != nil {
go func() {
for e := range events {
// e ~= watch.Event { ADDED, *api.Event }
log.V(1).Info(e)
}
}()
k.events = events
}
}
// watch pods from the given pod ListWatch // watch pods from the given pod ListWatch
_, k.podController = framework.NewInformer(config.PodLW, &api.Pod{}, podRelistPeriod, &framework.ResourceEventHandlerFuncs{ _, k.podController = framework.NewInformer(config.PodLW, &api.Pod{}, podRelistPeriod, &framework.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) { AddFunc: func(obj interface{}) {