Skip to content

Commit

Permalink
Merge pull request #2119 from vrutkovs/late-connection-host-fix
Browse files Browse the repository at this point in the history
NO-JIRA: UPSTREAM: fix request Host storing in openshift.io/during-graceful audit log annotation
  • Loading branch information
openshift-merge-bot[bot] authored Feb 19, 2025
2 parents cc907f5 + 99ea4b0 commit 79a6baf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ func WithLateConnectionFilter(handler http.Handler) http.Handler {
if late {
if pth := "/" + strings.TrimLeft(r.URL.Path, "/"); pth != "/readyz" && pth != "/healthz" && pth != "/livez" {
if isLocal(r) {
audit.AddAuditAnnotation(r.Context(), "openshift.io/during-graceful", fmt.Sprintf("loopback=true,%v,readyz=false", r.URL.Host))
audit.AddAuditAnnotation(r.Context(), "openshift.io/during-graceful", fmt.Sprintf("loopback=true,%v,readyz=false", r.Host))
klog.V(4).Infof("Loopback request to %q (user agent %q) through connection created very late in the graceful termination process (more than 80%% has passed). This client probably does not watch /readyz and might get failures when termination is over.", r.URL.Path, r.UserAgent())
} else {
audit.AddAuditAnnotation(r.Context(), "openshift.io/during-graceful", fmt.Sprintf("loopback=false,%v,readyz=false", r.URL.Host))
audit.AddAuditAnnotation(r.Context(), "openshift.io/during-graceful", fmt.Sprintf("loopback=false,%v,readyz=false", r.Host))
klog.Warningf("Request to %q (source IP %s, user agent %q) through a connection created very late in the graceful termination process (more than 80%% has passed), possibly a sign for a broken load balancer setup.", r.URL.Path, r.RemoteAddr, r.UserAgent())

// create only one event to avoid event spam.
Expand Down

0 comments on commit 79a6baf

Please sign in to comment.