From 423c1f8110f494a4950cd8b7cfaebf5287e05a74 Mon Sep 17 00:00:00 2001 From: Joel Takvorian Date: Mon, 25 Mar 2024 12:42:34 +0100 Subject: [PATCH] Change HOST/PORT env to TARGET_HOST / TARGET_PORT Depends on https://github.com/netobserv/netobserv-ebpf-agent/pull/303 --- controllers/ebpf/agent_controller.go | 4 ++-- controllers/flowcollector_controller_ebpf_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/controllers/ebpf/agent_controller.go b/controllers/ebpf/agent_controller.go index ebf433550..f77e9cb2e 100644 --- a/controllers/ebpf/agent_controller.go +++ b/controllers/ebpf/agent_controller.go @@ -31,8 +31,8 @@ const ( envExcludeInterfaces = "EXCLUDE_INTERFACES" envInterfaces = "INTERFACES" envAgentIP = "AGENT_IP" - envFlowsTargetHost = "HOST" - envFlowsTargetPort = "PORT" + envFlowsTargetHost = "TARGET_HOST" + envFlowsTargetPort = "TARGET_PORT" envSampling = "SAMPLING" envExport = "EXPORT" envKafkaBrokers = "KAFKA_BROKERS" diff --git a/controllers/flowcollector_controller_ebpf_test.go b/controllers/flowcollector_controller_ebpf_test.go index 668c2242d..2c57004ae 100644 --- a/controllers/flowcollector_controller_ebpf_test.go +++ b/controllers/flowcollector_controller_ebpf_test.go @@ -117,15 +117,15 @@ func flowCollectorEBPFSpecs() { v1.EnvVar{Name: "BUFFERS_LENGTH", Value: "100"}, v1.EnvVar{Name: "GOGC", Value: "400"}, v1.EnvVar{Name: "SAMPLING", Value: "123"}, - v1.EnvVar{Name: "PORT", Value: "9999"}, + v1.EnvVar{Name: "TARGET_PORT", Value: "9999"}, )) hostFound := false for _, env := range spec.Containers[0].Env { - if env.Name == "HOST" { + if env.Name == "TARGET_HOST" { if env.ValueFrom == nil || env.ValueFrom.FieldRef == nil || env.ValueFrom.FieldRef.FieldPath != "status.hostIP" { - Fail(fmt.Sprintf("HOST expected to refer to \"status.hostIP\"."+ + Fail(fmt.Sprintf("TARGET_HOST expected to refer to \"status.hostIP\"."+ " Got: %+v", env.ValueFrom)) } else { hostFound = true @@ -134,7 +134,7 @@ func flowCollectorEBPFSpecs() { } } Expect(hostFound).To(BeTrue(), - fmt.Sprintf("expected HOST env var in %+v", spec.Containers[0].Env)) + fmt.Sprintf("expected TARGET_HOST env var in %+v", spec.Containers[0].Env)) ns := v1.Namespace{} By("expecting to create the netobserv-privileged namespace")