From 5fe96e234d23fc53639cdbe9f3a7bb08a7a51208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Wed, 28 Feb 2024 10:44:37 +0100 Subject: [PATCH] integration: Reset `OTEL_EXPORTER_OTLP_ENDPOINT` for sub-daemons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When creating a new daemon in the `TestDaemonProxy`, reset the `OTEL_EXPORTER_OTLP_ENDPOINT` to an empty value to disable OTEL collection to avoid it hitting the proxy. Signed-off-by: Paweł Gronowski --- integration/daemon/daemon_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/integration/daemon/daemon_test.go b/integration/daemon/daemon_test.go index 60a9b3bc69..040e1253b5 100644 --- a/integration/daemon/daemon_test.go +++ b/integration/daemon/daemon_test.go @@ -208,6 +208,7 @@ func TestDaemonProxy(t *testing.T) { "HTTP_PROXY="+proxyServer.URL, "HTTPS_PROXY="+proxyServer.URL, "NO_PROXY=example.com", + "OTEL_EXPORTER_OTLP_ENDPOINT=", // To avoid OTEL hitting the proxy. )) c := d.NewClientT(t) @@ -245,6 +246,7 @@ func TestDaemonProxy(t *testing.T) { "https_proxy="+"https://"+userPass+"myuser:mypassword@from-env-https-invalid", "NO_PROXY=ignore.invalid", "no_proxy=ignore.invalid", + "OTEL_EXPORTER_OTLP_ENDPOINT=", // To avoid OTEL hitting the proxy. )) d.Start(t, "--iptables=false", "--http-proxy", proxyServer.URL, "--https-proxy", proxyServer.URL, "--no-proxy", "example.com") defer d.Stop(t) @@ -295,6 +297,7 @@ func TestDaemonProxy(t *testing.T) { "https_proxy="+"https://"+userPass+"myuser:mypassword@from-env-https-invalid", "NO_PROXY=ignore.invalid", "no_proxy=ignore.invalid", + "OTEL_EXPORTER_OTLP_ENDPOINT=", // To avoid OTEL hitting the proxy. )) c := d.NewClientT(t) @@ -364,7 +367,9 @@ func TestDaemonProxy(t *testing.T) { proxyURL = "https://xxxxx:xxxxx@example.org" ) - d := daemon.New(t) + d := daemon.New(t, daemon.WithEnvVars( + "OTEL_EXPORTER_OTLP_ENDPOINT=", // To avoid OTEL hitting the proxy. + )) d.Start(t, "--iptables=false", "--http-proxy", proxyRawURL, "--https-proxy", proxyRawURL, "--no-proxy", "example.com") defer d.Stop(t) err := d.Signal(syscall.SIGHUP)