mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 14:45:28 +00:00
Fix node Get() error code
This commit is contained in:
@@ -40,6 +40,9 @@ func NewHealthyRegistry(delegate Registry, client client.KubeletHealthChecker) R
|
||||
|
||||
func (r *HealthyRegistry) GetMinion(ctx api.Context, minionID string) (*api.Node, error) {
|
||||
minion, err := r.delegate.GetMinion(ctx, minionID)
|
||||
if err != nil {
|
||||
return minion, err
|
||||
}
|
||||
if minion == nil {
|
||||
return nil, ErrDoesNotExist
|
||||
}
|
||||
|
@@ -86,6 +86,9 @@ func (rs *REST) Delete(ctx api.Context, id string) (<-chan apiserver.RESTResult,
|
||||
// Get satisfies the RESTStorage interface.
|
||||
func (rs *REST) Get(ctx api.Context, id string) (runtime.Object, error) {
|
||||
minion, err := rs.registry.GetMinion(ctx, id)
|
||||
if err != nil {
|
||||
return minion, err
|
||||
}
|
||||
if minion == nil {
|
||||
return nil, ErrDoesNotExist
|
||||
}
|
||||
|
Reference in New Issue
Block a user