Skip to content

Commit

Permalink
Added dedup configuration for ebpf agent (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierCazade authored Nov 8, 2022
1 parent edc43bf commit 6bc767b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion controllers/ebpf/agent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ const (
envKafkaTLSUserCertPath = "KAFKA_TLS_USER_CERT_PATH"
envKafkaTLSUserKeyPath = "KAFKA_TLS_USER_KEY_PATH"
envLogLevel = "LOG_LEVEL"
envDedupe = "DEDUPE"
dedupeDefault = "firstCome"
envDedupeJustMark = "DEDUPE_JUST_MARK"
dedupeJustMarkDefault = "true"

envListSeparator = ","
)
Expand Down Expand Up @@ -235,9 +239,20 @@ func (c *AgentController) envConfig(coll *flowsv1alpha1.FlowCollector) []corev1.
Value: strconv.Itoa(int(*sampling)),
})
}
dedup := dedupeDefault
dedupJustMark := dedupeJustMarkDefault
for k, v := range coll.Spec.Agent.EBPF.Env {
config = append(config, corev1.EnvVar{Name: k, Value: v})
if k == envDedupe {
dedup = v
} else if k == envDedupeJustMark {
dedupJustMark = v
} else {
config = append(config, corev1.EnvVar{Name: k, Value: v})
}
}
config = append(config, corev1.EnvVar{Name: envDedupe, Value: dedup})
config = append(config, corev1.EnvVar{Name: envDedupeJustMark, Value: dedupJustMark})

if coll.Spec.UseKafka() {
config = append(config,
corev1.EnvVar{Name: envExport, Value: exportKafka},
Expand Down

0 comments on commit 6bc767b

Please sign in to comment.