mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 12:44:39 +00:00
runtime/network: Fix error reporting in listRoutes()
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.
fixes #1206
Forward port of
0ffaeeb5d8
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
1ae8e81abb
commit
e004616b02
@ -648,10 +648,10 @@ func (k *kataAgent) listRoutes() ([]*pbTypes.Route, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
resultRoutes, ok := resultingRoutes.(*grpc.Routes)
|
resultRoutes, ok := resultingRoutes.(*grpc.Routes)
|
||||||
if ok {
|
if !ok {
|
||||||
return resultRoutes.Routes, err
|
return nil, fmt.Errorf("Unexpected type %T for routes", resultingRoutes)
|
||||||
}
|
}
|
||||||
return nil, err
|
return resultRoutes.Routes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k *kataAgent) getAgentURL() (string, error) {
|
func (k *kataAgent) getAgentURL() (string, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user