Skip to content

Commit 2157941

Browse files
apetro2grcevski
andauthored
test(config): verify feature flags propagation to OBI (#2349)
* test(config): verify feature flags propagation to OBI * test(config): verify feature flags propagation to OBI --------- Co-authored-by: Nikola Grcevski <[email protected]>
1 parent 4c516ac commit 2157941

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/beyla/config_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,17 +619,24 @@ func TestOBIConfigConversion(t *testing.T) {
619619
cfg := DefaultConfig()
620620
cfg.Prometheus.Port = 6060
621621
cfg.Metrics.MetricsEndpoint = "http://localhost:4318"
622+
cfg.NetworkFlows.Enable = true
623+
cfg.Attributes.Kubernetes.Enable = kubeflags.EnabledTrue
624+
cfg.Attributes.HostID.Override = "test-instance-id"
625+
cfg.ServiceName = "test-service"
622626
cfg.Discovery = servicesextra.BeylaDiscoveryConfig{
623627
Instrument: services.GlobDefinitionCriteria{
624628
{Path: services.NewGlob("hello*")},
625629
{Path: services.NewGlob("bye*")},
626630
},
627631
}
628632

629-
// TODO: add more fields that you want to verify they are properly converted
630633
dst := cfg.AsOBI()
631634
assert.Equal(t, dst.Prometheus.Port, 6060)
632635
assert.Equal(t, dst.Metrics.MetricsEndpoint, "http://localhost:4318")
636+
assert.True(t, dst.NetworkFlows.Enable)
637+
assert.Equal(t, kubeflags.EnabledTrue, dst.Attributes.Kubernetes.Enable)
638+
assert.Equal(t, "test-instance-id", dst.Attributes.HostID.Override)
639+
assert.Equal(t, "test-service", dst.ServiceName)
633640
assert.Equal(t,
634641
services.GlobDefinitionCriteria{
635642
{Path: services.NewGlob("hello*")},

0 commit comments

Comments
 (0)