mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-30 15:01:24 +00:00
Merge pull request #1236 from igsilya/failure-logs
server: More concise error messages.
This commit is contained in:
commit
ad81dbf50f
@ -99,11 +99,7 @@ func (s *Server) HandleCNIRequest(cmd string, k8sArgs *types.K8sArgs, cniCmdArgs
|
|||||||
return []byte(""), fmt.Errorf("unknown cmd type: %s", cmd)
|
return []byte(""), fmt.Errorf("unknown cmd type: %s", cmd)
|
||||||
}
|
}
|
||||||
logging.Verbosef("%s finished CNI request %s, result: %q, err: %v", cmd, printCmdArgs(cniCmdArgs), string(result), err)
|
logging.Verbosef("%s finished CNI request %s, result: %q, err: %v", cmd, printCmdArgs(cniCmdArgs), string(result), err)
|
||||||
if err != nil {
|
return result, err
|
||||||
// Prefix errors with request info for easier failure debugging
|
|
||||||
return nil, fmt.Errorf("%s ERRORED: %v", printCmdArgs(cniCmdArgs), err)
|
|
||||||
}
|
|
||||||
return result, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HandleDelegateRequest is the CNI server handler function; it is invoked whenever
|
// HandleDelegateRequest is the CNI server handler function; it is invoked whenever
|
||||||
@ -129,11 +125,7 @@ func (s *Server) HandleDelegateRequest(cmd string, k8sArgs *types.K8sArgs, cniCm
|
|||||||
return []byte(""), fmt.Errorf("unknown cmd type: %s", cmd)
|
return []byte(""), fmt.Errorf("unknown cmd type: %s", cmd)
|
||||||
}
|
}
|
||||||
logging.Verbosef("%s finished Delegate request %s, result: %q, err: %v", cmd, printCmdArgs(cniCmdArgs), string(result), err)
|
logging.Verbosef("%s finished Delegate request %s, result: %q, err: %v", cmd, printCmdArgs(cniCmdArgs), string(result), err)
|
||||||
if err != nil {
|
return result, err
|
||||||
// Prefix errors with request info for easier failure debugging
|
|
||||||
return nil, fmt.Errorf("%s ERRORED: %v", printCmdArgs(cniCmdArgs), err)
|
|
||||||
}
|
|
||||||
return result, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetListener creates a listener to a unix socket located in `socketPath`
|
// GetListener creates a listener to a unix socket located in `socketPath`
|
||||||
@ -415,7 +407,7 @@ func (s *Server) handleCNIRequest(r *http.Request) ([]byte, error) {
|
|||||||
result, err := s.HandleCNIRequest(cmdType, k8sArgs, cniCmdArgs)
|
result, err := s.HandleCNIRequest(cmdType, k8sArgs, cniCmdArgs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Prefix error with request information for easier debugging
|
// Prefix error with request information for easier debugging
|
||||||
return nil, fmt.Errorf("%+v %v", cniCmdArgs, err)
|
return nil, fmt.Errorf("%s ERRORED: %v", printCmdArgs(cniCmdArgs), err)
|
||||||
}
|
}
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
@ -442,7 +434,7 @@ func (s *Server) handleDelegateRequest(r *http.Request) ([]byte, error) {
|
|||||||
result, err := s.HandleDelegateRequest(cmdType, k8sArgs, cniCmdArgs, cr.InterfaceAttributes)
|
result, err := s.HandleDelegateRequest(cmdType, k8sArgs, cniCmdArgs, cr.InterfaceAttributes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Prefix error with request information for easier debugging
|
// Prefix error with request information for easier debugging
|
||||||
return nil, fmt.Errorf("%s %v", printCmdArgs(cniCmdArgs), err)
|
return nil, fmt.Errorf("%s ERRORED: %v", printCmdArgs(cniCmdArgs), err)
|
||||||
}
|
}
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user