Document risk of HTTP response body in probe failure msg

This commit is contained in:
Tim Allclair 2023-02-09 16:37:32 -08:00
parent 9a51625ebe
commit 67f72d0e90

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.