From 24cee0e98706f190362bbfae292ce7b53e7bbe9a Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Wed, 7 Aug 2024 08:14:48 -0700 Subject: [PATCH] [chore] make httpforwarderextension use default client config for egress --- .../httpforwarderextension/config_test.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/extension/httpforwarderextension/config_test.go b/extension/httpforwarderextension/config_test.go index f6256b7867c6..62ac93e2cecf 100644 --- a/extension/httpforwarderextension/config_test.go +++ b/extension/httpforwarderextension/config_test.go @@ -23,6 +23,15 @@ func TestLoadConfig(t *testing.T) { maxIdleConns := 42 idleConnTimeout := 80 * time.Second + egressCfg := confighttp.NewDefaultClientConfig() + egressCfg.Endpoint = "http://target/" + egressCfg.Headers = map[string]configopaque.String{ + "otel_http_forwarder": "dev", + } + egressCfg.MaxIdleConns = &maxIdleConns + egressCfg.IdleConnTimeout = &idleConnTimeout + egressCfg.Timeout = 5 * time.Second + tests := []struct { id component.ID expected component.Config @@ -37,15 +46,7 @@ func TestLoadConfig(t *testing.T) { Ingress: confighttp.ServerConfig{ Endpoint: "http://localhost:7070", }, - Egress: confighttp.ClientConfig{ - Endpoint: "http://target/", - Headers: map[string]configopaque.String{ - "otel_http_forwarder": "dev", - }, - MaxIdleConns: &maxIdleConns, - IdleConnTimeout: &idleConnTimeout, - Timeout: 5 * time.Second, - }, + Egress: egressCfg, }, }, }