Skip to content

Commit f056241

Browse files
khrmtekton-robot
authored andcommitted
Fix Panic in the API server
API server gets panic under certain negative scenarios. We fixed that by creating a new variable for error.
1 parent 1352cec commit f056241

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/api/server/v1alpha2/plugin_logs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ func (s *LogPluginServer) getLokiLogs(writer *logs.BufferedLog, parent string, r
169169
req.Header.Set("Authorization", "Bearer "+token.AccessToken)
170170
resp, err := s.client.Do(req)
171171
if err != nil {
172-
dump, err := httputil.DumpRequest(req, true)
173-
if err == nil {
172+
dump, derr := httputil.DumpRequest(req, true)
173+
if derr == nil {
174174
s.logger.Debugf("Request Dump***:\n %q\n", dump)
175175
}
176176
s.logger.Errorf("request to loki failed, err: %s, req: %v", err.Error(), req)

0 commit comments

Comments
 (0)