Skip to content

Commit

Permalink
No need to parse response body of healthcheck.
Browse files Browse the repository at this point in the history
Only contains "error" and no additional information.
  • Loading branch information
Gerrit91 committed Nov 17, 2023
1 parent b84fa61 commit 474f715
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/controller/healthcheck/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package healthcheck
import (
"context"
"fmt"
"io"
"net/http"

"github.com/gardener/gardener/extensions/pkg/controller/healthcheck"
Expand Down Expand Up @@ -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")
}

0 comments on commit 474f715

Please sign in to comment.