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
Fix bug in which APIServerTracing did not work with some egress selectors #112979
Conversation
/remove-sig api-machinery |
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.
Should we backport this change?
|
||
otelDialer := func(ctx context.Context, addr string) (net.Conn, error) { | ||
return egressDialer(ctx, "tcp", addr) | ||
if egressDialer != nil { |
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.
what is going to happen if egressDialer is nil?
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.
It won't use a custom dialer in that case (it will just use the default dial function).
Edit: it is equivalent to not having an egress selector at all.
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.
huh... probably worth noting loudly in the Lookup documentation that this can return nil, nil
(and maybe sweeping for other callers that assume a nil error means a non-nil dialer)
ae30296
to
eea9347
Compare
Yes, I think we should. |
eea9347
to
00bcd6c
Compare
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.
/lgtm
/approve
/assign @liggitt |
/lgtm thanks for the added test case |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dashpole, liggitt, logicalhan 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 |
/triage accepted |
Thanks all! |
What type of PR is this?
/kind bug
/sig instrumentation
/priority important-soon
What this PR does / why we need it:
Prevent the APIServer from panicking when an egress selector without a dialer is used.
Which issue(s) this PR fixes:
Fixes #112976
Testing
I verified that test case added causes the API Server to panic as described in #112976, and that it no longer panics when the fix is applied.
Does this PR introduce a user-facing change?
/assign @logicalhan