mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-29 21:03:03 +00:00
Merge pull request #1207 from dgibson/bug1206
Fix error reporting in listInterfaces() and listRoutes()
This commit is contained in:
commit
e9e39fd081
@ -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) {
|
||||||
@ -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