mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-01 17:06:28 +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:
@@ -635,10 +635,10 @@ func (k *kataAgent) listInterfaces() ([]*pbTypes.Interface, error) {
|
||||
return nil, err
|
||||
}
|
||||
resultInterfaces, ok := resultingInterfaces.(*grpc.Interfaces)
|
||||
if ok {
|
||||
return resultInterfaces.Interfaces, err
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("Unexpected type %T for interfaces", resultingInterfaces)
|
||||
}
|
||||
return nil, err
|
||||
return resultInterfaces.Interfaces, nil
|
||||
}
|
||||
|
||||
func (k *kataAgent) listRoutes() ([]*pbTypes.Route, error) {
|
||||
|
Reference in New Issue
Block a user