Skip to content

Commit

Permalink
chore: Check all errors on sendAdmissionReviewToPolicyServer()
Browse files Browse the repository at this point in the history
Signed-off-by: Víctor Cuadrado Juan <[email protected]>
  • Loading branch information
viccuad committed Jul 31, 2024
1 parent 1c19b0f commit 998eddd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,10 @@ func (s *Scanner) sendAdmissionReviewToPolicyServer(ctx context.Context, url *ur
return nil, err
}

req, _ := http.NewRequestWithContext(ctx, http.MethodPost, url.String(), bytes.NewBuffer(payload))
req, err := http.NewRequestWithContext(ctx, http.MethodPost, url.String(), bytes.NewBuffer(payload))
if err != nil {
return nil, err

Check warning on line 524 in internal/scanner/scanner.go

View check run for this annotation

Codecov / codecov/patch

internal/scanner/scanner.go#L524

Added line #L524 was not covered by tests
}
req.Header.Add("Content-Type", "application/json")

res, err := s.httpClient.Do(req)
Expand Down

0 comments on commit 998eddd

Please sign in to comment.