Fix bug in which APIServerTracing did not work with some egress selectors

Kubernetes-commit: 00bcd6cf01b719d0fddc8331ffecd3de35e8896f
This commit is contained in:
David Ashpole 2022-10-11 16:22:33 +00:00 committed by Kubernetes Publisher
parent f1ba5b4065
commit 73fdf7e37b
1 changed files with 5 additions and 4 deletions

View File

@ -101,12 +101,13 @@ func (o *TracingOptions) ApplyTo(es *egressselector.EgressSelector, c *server.Co
if err != nil {
return err
}
if egressDialer != nil {
otelDialer := func(ctx context.Context, addr string) (net.Conn, error) {
return egressDialer(ctx, "tcp", addr)
}
opts = append(opts, otlptracegrpc.WithDialOption(grpc.WithContextDialer(otelDialer)))
}
}
resourceOpts := []resource.Option{
resource.WithAttributes(