mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-11-04 03:29:55 +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:
		@@ -648,10 +648,10 @@ func (k *kataAgent) listRoutes() ([]*pbTypes.Route, error) {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	resultRoutes, ok := resultingRoutes.(*grpc.Routes)
 | 
			
		||||
	if ok {
 | 
			
		||||
		return resultRoutes.Routes, err
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return nil, fmt.Errorf("Unexpected type %T for routes", resultingRoutes)
 | 
			
		||||
	}
 | 
			
		||||
	return nil, err
 | 
			
		||||
	return resultRoutes.Routes, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (k *kataAgent) getAgentURL() (string, error) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user