Skip to content

Commit

Permalink
Change HOST/PORT env to TARGET_HOST / TARGET_PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Mar 25, 2024
1 parent c08b28b commit 423c1f8
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 = "HOST"
envFlowsTargetPort = "PORT"
envFlowsTargetHost = "TARGET_HOST"
envFlowsTargetPort = "TARGET_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: "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
Expand All @@ -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")
Expand Down

0 comments on commit 423c1f8

Please sign in to comment.