From 67d88e73c16a194bc65ad4e63ede20231dfb3f95 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Fri, 17 Nov 2023 15:30:16 +0100 Subject: [PATCH] No need to parse response body of healthcheck. (#10) Only contains "error" and no additional information. --- pkg/controller/healthcheck/backend.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/controller/healthcheck/backend.go b/pkg/controller/healthcheck/backend.go index 7246d9e..c903342 100644 --- a/pkg/controller/healthcheck/backend.go +++ b/pkg/controller/healthcheck/backend.go @@ -3,7 +3,6 @@ package healthcheck import ( "context" "fmt" - "io" "net/http" "github.com/gardener/gardener/extensions/pkg/controller/healthcheck" @@ -65,10 +64,5 @@ func (h *BackendHealthChecker) check(ctx context.Context, namespace string) erro return nil } - body, err := io.ReadAll(resp.Body) - if err != nil { - return fmt.Errorf("unable to read http body: %w", err) - } - - return fmt.Errorf("backend is unhealthy since errors or failued have occurred in the last minute time frame: %s", string(body)) + return fmt.Errorf("backend is unhealthy since errors or failures have occurred in the last minute time frame") }