mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
Enable watch on node changes.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user