Enable watch on node changes.

This commit is contained in:
Deyuan Deng
2014-11-25 19:25:23 -05:00
parent f2a5457296
commit 45bfcb451b
8 changed files with 176 additions and 19 deletions

View File

@@ -20,15 +20,20 @@ import (
"sync"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
)
// MinionRegistry implements minion.Registry interface.
type MinionRegistry struct {
Err error
Minion string
Minions api.NodeList
sync.Mutex
}
// MakeMinionList constructs api.MinionList from list of minion names and a NodeResource.
func MakeMinionList(minions []string, nodeResources api.NodeResources) *api.NodeList {
list := api.NodeList{
Items: make([]api.Node, len(minions)),
@@ -95,3 +100,7 @@ func (r *MinionRegistry) DeleteMinion(ctx api.Context, minionID string) error {
r.Minions.Items = newList
return r.Err
}
func (r *MinionRegistry) WatchMinions(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error) {
return nil, r.Err
}

View File

@@ -65,7 +65,6 @@ func (r *PodRegistry) ListPods(ctx api.Context, selector labels.Selector) (*api.
func (r *PodRegistry) WatchPods(ctx api.Context, label, field labels.Selector, resourceVersion string) (watch.Interface, error) {
return r.broadcaster.Watch(), nil
}
func (r *PodRegistry) GetPod(ctx api.Context, podId string) (*api.Pod, error) {