chore(workloadmonitor): discard best-effort close errors explicitly

The Prometheus response body is closed after it has been read, and the
test stubs' writes fail on the client side of the test, so neither
error changes a result.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
Aleksei Sviridkin committed 2026-11-13 12:35:01 +03:00
1 parent 87b794a992
commit 7a481c4765
2 files changed
+6 -6

No files matched your search

@@ -525,7 +525,7 @@ func (r *WorkloadMonitorReconciler) queryAllBucketMetrics(ctx context.Context, p
if err != nil {
return nil, fmt.Errorf("querying Prometheus: %w", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("unexpected status %d from Prometheus", resp.StatusCode)