Skip to content

Commit

Permalink
eBPF env renaming (netobserv#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinsonneau authored Mar 25, 2024
1 parent aec091e commit c08b28b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions controllers/ebpf/agent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const (
envExcludeInterfaces = "EXCLUDE_INTERFACES"
envInterfaces = "INTERFACES"
envAgentIP = "AGENT_IP"
envFlowsTargetHost = "FLOWS_TARGET_HOST"
envFlowsTargetPort = "FLOWS_TARGET_PORT"
envFlowsTargetHost = "HOST"
envFlowsTargetPort = "PORT"
envSampling = "SAMPLING"
envExport = "EXPORT"
envKafkaBrokers = "KAFKA_BROKERS"
Expand Down
8 changes: 4 additions & 4 deletions controllers/flowcollector_controller_ebpf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: "FLOWS_TARGET_PORT", Value: "9999"},
v1.EnvVar{Name: "PORT", Value: "9999"},
))
hostFound := false
for _, env := range spec.Containers[0].Env {
if env.Name == "FLOWS_TARGET_HOST" {
if env.Name == "HOST" {
if env.ValueFrom == nil ||
env.ValueFrom.FieldRef == nil ||
env.ValueFrom.FieldRef.FieldPath != "status.hostIP" {
Fail(fmt.Sprintf("FLOWS_TARGET_HOST expected to refer to \"status.hostIP\"."+
Fail(fmt.Sprintf("HOST expected to refer to \"status.hostIP\"."+
" Got: %+v", env.ValueFrom))
} else {
hostFound = true
Expand All @@ -134,7 +134,7 @@ func flowCollectorEBPFSpecs() {
}
}
Expect(hostFound).To(BeTrue(),
fmt.Sprintf("expected FLOWS_TARGET_HOST env var in %+v", spec.Containers[0].Env))
fmt.Sprintf("expected HOST env var in %+v", spec.Containers[0].Env))

ns := v1.Namespace{}
By("expecting to create the netobserv-privileged namespace")
Expand Down

0 comments on commit c08b28b

Please sign in to comment.