From 285f0bb651192115743c7764d60e16e5fe4a0ef9 Mon Sep 17 00:00:00 2001 From: Andrew Gizas Date: Wed, 11 Oct 2023 09:50:34 +0300 Subject: [PATCH] Disable Deployment and Replicaset enrichment by default (#62) Disabling AddResourceMetadataConfig.Deployment: false and AddResourceMetadataConfig.Cronjob: false as per discussion here https://github.com/elastic/elastic-agent-autodiscover/issues/31#issuecomment-1745057020 --- kubernetes/metadata/config.go | 4 ++-- kubernetes/metadata/pod_test.go | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/kubernetes/metadata/config.go b/kubernetes/metadata/config.go index 2fcbf99986..8ddce4eb65 100644 --- a/kubernetes/metadata/config.go +++ b/kubernetes/metadata/config.go @@ -63,7 +63,7 @@ func GetDefaultResourceMetadataConfig() *AddResourceMetadataConfig { return &AddResourceMetadataConfig{ Node: metaCfg, Namespace: metaCfg, - Deployment: true, - CronJob: true, + Deployment: false, + CronJob: false, } } diff --git a/kubernetes/metadata/pod_test.go b/kubernetes/metadata/pod_test.go index f5ac59b199..4877b7e0a5 100644 --- a/kubernetes/metadata/pod_test.go +++ b/kubernetes/metadata/pod_test.go @@ -345,9 +345,10 @@ func TestPod_Generate(t *testing.T) { "ip": "127.0.0.5", }, "namespace": defaultNs, - "deployment": mapstr.M{ - "name": "nginx-deployment", - }, + // We comment below block because add_resource_metadata.deployment: false by default + // "deployment": mapstr.M{ + // "name": "nginx-deployment", + // }, "replicaset": mapstr.M{ "name": "nginx-rs", }, @@ -403,9 +404,10 @@ func TestPod_Generate(t *testing.T) { "ip": "127.0.0.5", }, "namespace": defaultNs, - "deployment": mapstr.M{ - "name": "nginx-deployment", - }, + // We comment below block because add_resource_metadata.deployment: false by default + // "deployment": mapstr.M{ + // "name": "nginx-deployment", + // }, "replicaset": mapstr.M{ "name": "nginx-rs", },