mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 15:32:30 +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
0fd70f7ec3
commit
fce14f3697
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user