diff --git a/driver/docker-container/driver.go b/driver/docker-container/driver.go index e0b477a4..f81ad8a3 100644 --- a/driver/docker-container/driver.go +++ b/driver/docker-container/driver.go @@ -366,11 +366,14 @@ func (d *Driver) Client(ctx context.Context) (*client.Client, error) { return nil, err } - td, _ := exp.(client.TracerDelegate) - - return client.New(ctx, "", client.WithContextDialer(func(context.Context, string) (net.Conn, error) { + var opts []client.ClientOpt + opts = append(opts, client.WithContextDialer(func(context.Context, string) (net.Conn, error) { return conn, nil - }), client.WithTracerDelegate(td)) + })) + if td, ok := exp.(client.TracerDelegate); ok { + opts = append(opts, client.WithTracerDelegate(td)) + } + return client.New(ctx, "", opts...) } func (d *Driver) Factory() driver.Factory { diff --git a/driver/kubernetes/driver.go b/driver/kubernetes/driver.go index 7fae8170..39e8c528 100644 --- a/driver/kubernetes/driver.go +++ b/driver/kubernetes/driver.go @@ -215,11 +215,14 @@ func (d *Driver) Client(ctx context.Context) (*client.Client, error) { return nil, err } - td, _ := exp.(client.TracerDelegate) - - return client.New(ctx, "", client.WithContextDialer(func(context.Context, string) (net.Conn, error) { + var opts []client.ClientOpt + opts = append(opts, client.WithContextDialer(func(context.Context, string) (net.Conn, error) { return conn, nil - }), client.WithTracerDelegate(td)) + })) + if td, ok := exp.(client.TracerDelegate); ok { + opts = append(opts, client.WithTracerDelegate(td)) + } + return client.New(ctx, "", opts...) } func (d *Driver) Factory() driver.Factory {