-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop special logic for kubelet probe header for istio #950
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #950 +/- ##
=======================================
Coverage 93.43% 93.43%
=======================================
Files 36 36
Lines 1249 1249
=======================================
Hits 1167 1167
Misses 69 69
Partials 13 13 ☔ View full report in Codecov by Sentry. |
/retest |
The downstream test TestIgnoreProbe fails since it is setting k-kubelet-probe to signal a kubelet probe, however the logic to determine a kubelet probe is now different and no longer checks for the custom header. |
These constants are used in knative/pkg - we do not want to deprecate them |
Whoops my bad - for some reason I thought |
pkg/deprecated_header.go
Outdated
// KubeletProbeKey is the name of the header supplied by kubelet | ||
// probes. Istio with mTLS rewrites probes, but their probes pass a | ||
// different user-agent. So we augment the probes with this header. | ||
// | ||
// Deprecated: use knative.dev/networking/pkg/http/header.UserAgentKey | ||
KubeletProbeKey = header.UserAgentKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop this addtion - we don't need to introduce a new field here
pkg/deprecated_header.go
Outdated
// Deprecated: use knative.dev/networking/pkg/http/header.UserAgentKey | ||
KubeletProbeHeaderName = header.UserAgentKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave this referencing header.KubeletProbeKey
as before
pkg/http/header/header.go
Outdated
@@ -58,6 +58,8 @@ const ( | |||
// KubeletProbeKey is the name of the header supplied by kubelet | |||
// probes. Istio with mTLS rewrites probes, but their probes pass a | |||
// different user-agent. So we augment the probes with this header. | |||
// | |||
// Deprecated: use knative.dev/networking/pkg/http/header.UserAgentKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be more specific in this deprecation notice and say we want to detect probes with header.UserAgentKey
and KubeProbeUAPrefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made changes. Let me know if the text makes sense
pkg/http/header/header.go
Outdated
func IsKubeletProbe(r *http.Request) bool { | ||
return strings.HasPrefix(r.Header.Get("User-Agent"), KubeProbeUAPrefix) || | ||
r.Header.Get(KubeletProbeKey) != "" | ||
return strings.HasPrefix(r.Header.Get("User-Agent"), KubeProbeUAPrefix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should leave this as is for now and then remove the use of K-Kubelet-Probe
after a release or two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there's a minor drift between the queue proxy and the deployment then we want to prevent things from blowing up.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, izabelacg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Part of knative/serving#14981