Skip to content

Commit

Permalink
Fix Panic in the API server
Browse files Browse the repository at this point in the history
API server gets panic under certain negative scenarios.
We fixed that by creating a new variable for error.
  • Loading branch information
khrm authored and tekton-robot committed Nov 4, 2024
1 parent 1352cec commit f056241
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/api/server/v1alpha2/plugin_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ func (s *LogPluginServer) getLokiLogs(writer *logs.BufferedLog, parent string, r
req.Header.Set("Authorization", "Bearer "+token.AccessToken)
resp, err := s.client.Do(req)
if err != nil {
dump, err := httputil.DumpRequest(req, true)
if err == nil {
dump, derr := httputil.DumpRequest(req, true)
if derr == nil {
s.logger.Debugf("Request Dump***:\n %q\n", dump)
}
s.logger.Errorf("request to loki failed, err: %s, req: %v", err.Error(), req)
Expand Down

0 comments on commit f056241

Please sign in to comment.