mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 07:48:55 +00:00
runtime/network: Correct error reporting in listInterfaces()
If the upcast from resultingInterfaces to *grpc.Interfaces fails, we
return (nil, err), but previous code ensures that err is nil at that
point, so we return no error.
Forward port of
b86e904c2d
fixes #1206
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
1b2ccf87f8
commit
1ae8e81abb
@ -635,10 +635,10 @@ func (k *kataAgent) listInterfaces() ([]*pbTypes.Interface, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
resultInterfaces, ok := resultingInterfaces.(*grpc.Interfaces)
|
resultInterfaces, ok := resultingInterfaces.(*grpc.Interfaces)
|
||||||
if ok {
|
if !ok {
|
||||||
return resultInterfaces.Interfaces, err
|
return nil, fmt.Errorf("Unexpected type %T for interfaces", resultingInterfaces)
|
||||||
}
|
}
|
||||||
return nil, err
|
return resultInterfaces.Interfaces, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k *kataAgent) listRoutes() ([]*pbTypes.Route, error) {
|
func (k *kataAgent) listRoutes() ([]*pbTypes.Route, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user