Change:
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks! If the matter is security related, please disclose it privately via --Used a HTTP probe with external redirect: Got warning: Kubelet logs show: Warning messages either show additional context or don't show . I would probably have expected or just Not a big deal, just a bit confusing message Apply yaml above Kubernetes version (use ): v1.22.0-beta.1 Cloud provider or hardware configuration: kind OS (e.g: ): linux Kernel (e.g. ): 5.10.40 Install tools: kind /sig node
According to See and
thanks! I am not concerned about the actual implementation behavior, but rather the event: . We should not have an event ending with as it denotes there is more information to follow, but there is not.
Got it. /assign
/triage accepted I send to fix this issue.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules: After 90d of inactivity, is applied After 30d of inactivity since was applied, is applied After 30d of inactivity since was applied, the issue is closed You can: Mark this issue or PR as fresh with Mark this issue or PR as rotten with Close this issue or PR with Offer to help out with [Issue Triage][1] Please send feedback to sig-contributor-experience at . /lifecycle stale [1]:
In 1.18 (because of EKS long term support I don't really want to get into), I get this: This is mildly aggravating, as it means I get fourteen lines of warning logs indicating that a service which exists solely to provide redirects is working as expected. Does this bug mean that I'll instead get an even more aggravating warning when I eventually upgrade? :) I found this bug while looking for a way to tell the probe that "getting a 308 or 302 or <insert one or a list of values heremeans success". It'd be ideal in my mind if the httpget probe allowed an "ok return values array" which accepted either single values or ranges, perhaps with a default value like .
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules: After 90d of inactivity, is applied After 30d of inactivity since was applied, is applied After 30d of inactivity since was applied, the issue is closed You can: Mark this issue or PR as fresh with Close this issue or PR with Offer to help out with [Issue Triage][1] Please send feedback to sig-contributor-experience at . /lifecycle rotten [1]:

Discussion:
if res.StatusCode >= http.StatusOK && res.StatusCode < http.StatusBadRequest { if res.StatusCode >= http.StatusMultipleChoices { // Redirect klog.V(4).Infof("Probe terminated redirects for %s, Response: %v", url.String(), *res) <del> return probe.Warning, body, nil </del> <ins> return probe.Warning, fmt.Sprintf("Probe terminated redirects, Response body: %v", body), nil </ins> } klog.V(4).Infof("Probe succeeded for %s, Response: %v", url.String(), *res) return probe.Success, body, nil

} } <ins> redirectHandlerWithBody := func(s int, body string) func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/" { http.Redirect(w, r, "/new", s) } else if r.URL.Path == "/new" { w.WriteHeader(s) w.Write([]byte(body)) } } } </ins> followNonLocalRedirects := true prober := New(followNonLocalRedirects) testCases := []struct {

handler: redirectHandler(http.StatusPermanentRedirect, true), // 308 health:  probe.Failure, }, <ins> { handler: redirectHandlerWithBody(http.StatusPermanentRedirect, ""), // redirect with empty body health:  probe.Warning, accBody: "Probe terminated redirects, Response body:", }, { handler: redirectHandlerWithBody(http.StatusPermanentRedirect, "ok body"), // redirect with body health:  probe.Warning, accBody: "Probe terminated redirects, Response body: ok body", }, </ins> } for i, test := range testCases { t.Run(fmt.Sprintf("case-%2d", i), func(t *testing.T) {

"reason":                   events.ContainerProbeWarning, }.AsSelector().String() framework.ExpectNoError(e2eevents.WaitTimeoutForEvent( <del> f.ClientSet, f.Namespace.Name, expectedEvent, "0.0.0.0", framework.PodEventTimeout)) </del> <ins> f.ClientSet, f.Namespace.Name, expectedEvent, "Probe terminated redirects, Response body: <a href="http://0.0.0.0/">Found</a>.", framework.PodEventTimeout)) </ins> }) /*