mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 13:12:20 +00:00
HealthyRegistry should only decorate minions, not omit them
Fixes #3098
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
|
||||
)
|
||||
@@ -80,12 +81,15 @@ func (r *MinionRegistry) UpdateMinion(ctx api.Context, minion *api.Node) error {
|
||||
func (r *MinionRegistry) GetMinion(ctx api.Context, minionID string) (*api.Node, error) {
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
if r.Err != nil {
|
||||
return nil, r.Err
|
||||
}
|
||||
for _, node := range r.Minions.Items {
|
||||
if node.Name == minionID {
|
||||
return &node, r.Err
|
||||
return &node, nil
|
||||
}
|
||||
}
|
||||
return nil, r.Err
|
||||
return nil, errors.NewNotFound("node", minionID)
|
||||
}
|
||||
|
||||
func (r *MinionRegistry) DeleteMinion(ctx api.Context, minionID string) error {
|
||||
|
Reference in New Issue
Block a user