Merge pull request #115670 from tallclair/httpprobe

Document risk of HTTP response body in probe failure msg
This commit is contained in:
Kubernetes Prow Robot 2023-02-14 10:31:43 -08:00 committed by GitHub
commit 125e38c087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,7 +117,9 @@ func DoHTTPProbe(req *http.Request, client GetHTTPInterface) (probe.Result, stri
return probe.Success, body, nil
}
klog.V(4).Infof("Probe failed for %s with request headers %v, response body: %v", url.String(), headers, body)
return probe.Failure, fmt.Sprintf("HTTP probe failed with statuscode: %d", res.StatusCode), nil
// Note: Until https://issue.k8s.io/99425 is addressed, this user-facing failure message must not contain the response body.
failureMsg := fmt.Sprintf("HTTP probe failed with statuscode: %d", res.StatusCode)
return probe.Failure, failureMsg, nil
}
// RedirectChecker returns a function that can be used to check HTTP redirects.