Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
network: Fix error reporting in listRoutes()
Browse files Browse the repository at this point in the history
If the upcast from resultingRoutes to *grpc.IRoutes fails, we return
(nil, err), but previous code ensures that err is nil at that point, so we
return no error.

Signed-off-by: David Gibson <[email protected]>
  • Loading branch information
dgibson committed Oct 29, 2020
1 parent b86e904 commit 0ffaeeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions virtcontainers/kata_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,10 @@ func (k *kataAgent) listRoutes() ([]*vcTypes.Route, error) {
return nil, err
}
resultRoutes, ok := resultingRoutes.(*grpc.Routes)
if ok {
return k.convertToRoutes(resultRoutes.Routes), err
if !ok {
return nil, fmt.Errorf("Unexpected type %T for routes", resultingRoutes)
}
return nil, err
return k.convertToRoutes(resultRoutes.Routes), nil
}

func (k *kataAgent) startProxy(sandbox *Sandbox) error {
Expand Down

0 comments on commit 0ffaeeb

Please sign in to comment.