From 3f147316f922e55fad3aaf788b7f9a51abdc2f98 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 29 Mar 2024 16:24:09 +0800 Subject: [PATCH] fix: close res body Signed-off-by: guoguangwu --- gateway/metrics/exporter.go | 1 + 1 file changed, 1 insertion(+) diff --git a/gateway/metrics/exporter.go b/gateway/metrics/exporter.go index e8ced9dd1..b875ad30f 100644 --- a/gateway/metrics/exporter.go +++ b/gateway/metrics/exporter.go @@ -158,6 +158,7 @@ func (e *Exporter) getFunctions(endpointURL url.URL, namespace string) ([]types. if err != nil { return services, err } + defer res.Body.Close() bytesOut, readErr := io.ReadAll(res.Body) if readErr != nil {