From d7c786b696cb033a1ca3efda5a25025dcf6f916b Mon Sep 17 00:00:00 2001 From: Dustin Long Date: Thu, 21 Nov 2024 19:22:47 -0500 Subject: [PATCH] Use UnmarshalKey in more callsites (#31148) Co-authored-by: hush-hush --- comp/api/authtoken/go.mod | 34 ++++---- comp/forwarder/defaultforwarder/go.mod | 34 ++++---- .../orchestrator/orchestratorinterface/go.mod | 34 ++++---- comp/logs/agent/config/go.mod | 38 ++++----- comp/otelcol/ddflareextension/impl/go.mod | 28 +++---- comp/otelcol/logsagentpipeline/go.mod | 36 ++++----- .../logsagentpipelineimpl/go.mod | 34 ++++---- .../exporter/datadogexporter/go.mod | 28 +++---- .../exporter/logsagentexporter/go.mod | 38 ++++----- .../exporter/serializerexporter/go.mod | 28 +++---- comp/trace/config/setup.go | 9 ++- go.mod | 20 ++--- pkg/api/go.mod | 38 ++++----- pkg/collector/python/datadog_agent.go | 3 +- pkg/config/model/viper_test.go | 1 + pkg/config/remote/go.mod | 39 +++++----- pkg/config/setup/config.go | 2 + pkg/config/structure/go.mod | 2 +- pkg/config/structure/unmarshal.go | 78 +++++++++++++++---- pkg/config/structure/unmarshal_test.go | 45 +++++++---- pkg/config/utils/go.mod | 38 ++++----- pkg/config/utils/metadata_providers.go | 3 +- pkg/logs/auditor/go.mod | 36 ++++----- pkg/logs/client/go.mod | 38 ++++----- pkg/logs/diagnostic/go.mod | 36 ++++----- .../auto_multiline_detection/user_samples.go | 3 +- pkg/logs/message/go.mod | 36 ++++----- pkg/logs/pipeline/go.mod | 36 ++++----- pkg/logs/processor/go.mod | 36 ++++----- pkg/logs/sds/go.mod | 36 ++++----- pkg/logs/sender/go.mod | 38 ++++----- pkg/logs/sources/go.mod | 36 ++++----- pkg/logs/util/testutils/go.mod | 36 ++++----- pkg/network/config/replace_rules.go | 3 +- pkg/serializer/go.mod | 34 ++++---- pkg/snmp/snmp.go | 28 ++----- pkg/snmp/snmpparse/config_snmp.go | 36 +++------ pkg/snmp/snmpparse/config_snmp_test.go | 6 +- pkg/util/grpc/go.mod | 37 +++++---- test/otel/go.mod | 34 ++++---- 40 files changed, 604 insertions(+), 551 deletions(-) diff --git a/comp/api/authtoken/go.mod b/comp/api/authtoken/go.mod index e0489f7f56c790..366648b4358767 100644 --- a/comp/api/authtoken/go.mod +++ b/comp/api/authtoken/go.mod @@ -19,6 +19,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/model => ../../../pkg/config/model github.com/DataDog/datadog-agent/pkg/config/nodetreemodel => ../../../pkg/config/nodetreemodel github.com/DataDog/datadog-agent/pkg/config/setup => ../../../pkg/config/setup + github.com/DataDog/datadog-agent/pkg/config/structure => ../../../pkg/config/structure github.com/DataDog/datadog-agent/pkg/config/teeconfig => ../../../pkg/config/teeconfig github.com/DataDog/datadog-agent/pkg/config/utils => ../../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/util/defaultpaths => ../../../pkg/util/defaultpaths @@ -45,7 +46,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/log/mock v0.58.0-devel github.com/DataDog/datadog-agent/pkg/api v0.56.0 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0 - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 github.com/stretchr/testify v1.9.0 go.uber.org/fx v1.22.2 ) @@ -53,26 +54,27 @@ require ( require ( github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.0 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.0 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/log/setup v0.58.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/comp/forwarder/defaultforwarder/go.mod b/comp/forwarder/defaultforwarder/go.mod index 95c90138fe6b92..f6ff557ad4a8b2 100644 --- a/comp/forwarder/defaultforwarder/go.mod +++ b/comp/forwarder/defaultforwarder/go.mod @@ -21,6 +21,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/model => ../../../pkg/config/model github.com/DataDog/datadog-agent/pkg/config/nodetreemodel => ../../../pkg/config/nodetreemodel github.com/DataDog/datadog-agent/pkg/config/setup => ../../../pkg/config/setup + github.com/DataDog/datadog-agent/pkg/config/structure => ../../../pkg/config/structure github.com/DataDog/datadog-agent/pkg/config/teeconfig => ../../../pkg/config/teeconfig github.com/DataDog/datadog-agent/pkg/config/utils => ../../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/obfuscate => ../../../pkg/obfuscate @@ -57,20 +58,20 @@ require ( github.com/DataDog/datadog-agent/comp/core/log/mock v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/api v0.57.1 - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/config/utils v0.57.1 github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/status/health v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/common v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.57.1 github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 github.com/DataDog/datadog-agent/pkg/version v0.57.1 github.com/golang/protobuf v1.5.3 github.com/hashicorp/go-multierror v1.1.1 @@ -83,21 +84,22 @@ require ( require ( github.com/DataDog/datadog-agent/comp/core/flare/builder v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.57.1 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/log/setup v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/comp/forwarder/orchestrator/orchestratorinterface/go.mod b/comp/forwarder/orchestrator/orchestratorinterface/go.mod index 8061abb3cdc0f4..f2baa85f6fe887 100644 --- a/comp/forwarder/orchestrator/orchestratorinterface/go.mod +++ b/comp/forwarder/orchestrator/orchestratorinterface/go.mod @@ -22,6 +22,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/model => ../../../../pkg/config/model github.com/DataDog/datadog-agent/pkg/config/nodetreemodel => ../../../../pkg/config/nodetreemodel github.com/DataDog/datadog-agent/pkg/config/setup => ../../../../pkg/config/setup + github.com/DataDog/datadog-agent/pkg/config/structure => ../../../../pkg/config/structure github.com/DataDog/datadog-agent/pkg/config/teeconfig => ../../../../pkg/config/teeconfig github.com/DataDog/datadog-agent/pkg/config/utils => ../../../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/obfuscate => ../../../../pkg/obfuscate @@ -69,17 +70,18 @@ require ( github.com/DataDog/datadog-agent/comp/core/flare/builder v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/log/def v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/api v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.56.0-rc.3 // indirect @@ -87,18 +89,18 @@ require ( github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/common v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.57.1 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/comp/logs/agent/config/go.mod b/comp/logs/agent/config/go.mod index c0e125cf99fcb5..db73485ea4ca47 100644 --- a/comp/logs/agent/config/go.mod +++ b/comp/logs/agent/config/go.mod @@ -38,13 +38,13 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/core/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 github.com/DataDog/viper v1.13.5 github.com/stretchr/testify v1.9.0 go.uber.org/fx v1.22.2 @@ -53,21 +53,21 @@ require ( require ( github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect diff --git a/comp/otelcol/ddflareextension/impl/go.mod b/comp/otelcol/ddflareextension/impl/go.mod index ebd7b3b7636e61..7c025399330b9b 100644 --- a/comp/otelcol/ddflareextension/impl/go.mod +++ b/comp/otelcol/ddflareextension/impl/go.mod @@ -109,7 +109,7 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/datadogexporter v0.59.0 github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/processor/infraattributesprocessor v0.59.0 github.com/DataDog/datadog-agent/pkg/api v0.57.1 - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.1 + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 github.com/DataDog/datadog-agent/pkg/version v0.58.1 github.com/google/go-cmp v0.6.0 github.com/gorilla/mux v1.8.1 @@ -181,7 +181,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.58.1 // indirect github.com/DataDog/datadog-agent/comp/core/log/def v0.58.1 // indirect github.com/DataDog/datadog-agent/comp/core/log/mock v0.58.0-devel // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.58.1 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/tagger/tags v0.0.0-00010101000000-000000000000 // indirect github.com/DataDog/datadog-agent/comp/core/tagger/types v0.59.0 // indirect @@ -202,12 +202,12 @@ require ( github.com/DataDog/datadog-agent/comp/trace/compression/def v0.59.0-rc.6 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.59.0-rc.6 // indirect github.com/DataDog/datadog-agent/pkg/aggregator/ckey v0.59.0-rc.6 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0-rc.6 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.59.0-rc.6 // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0-rc.6 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.58.1 // indirect github.com/DataDog/datadog-agent/pkg/logs/auditor v0.58.1 // indirect @@ -238,24 +238,24 @@ require ( github.com/DataDog/datadog-agent/pkg/util/buf v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/cgroups v0.58.1 // indirect github.com/DataDog/datadog-agent/pkg/util/common v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.58.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.58.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.58.1 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.58.1 // indirect github.com/DataDog/datadog-agent/pkg/util/json v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/log/setup v0.58.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.58.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.58.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/startstop v0.58.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.58.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.58.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.58.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/utilizationtracker v0.0.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.58.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.31.0 // indirect github.com/DataDog/datadog-go/v5 v5.5.0 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect diff --git a/comp/otelcol/logsagentpipeline/go.mod b/comp/otelcol/logsagentpipeline/go.mod index 8a89effaebdc01..7fe6d0865adf04 100644 --- a/comp/otelcol/logsagentpipeline/go.mod +++ b/comp/otelcol/logsagentpipeline/go.mod @@ -65,17 +65,17 @@ require github.com/DataDog/datadog-agent/pkg/logs/pipeline v0.56.0-rc.3 require ( github.com/DataDog/agent-payload/v5 v5.0.106 // indirect github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/auditor v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/client v0.56.0-rc.3 // indirect @@ -91,21 +91,21 @@ require ( github.com/DataDog/datadog-agent/pkg/status/health v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/utilizationtracker v0.0.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect github.com/DataDog/viper v1.13.5 // indirect diff --git a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod index f1deca77ff94ca..ee142226df975b 100644 --- a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod +++ b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod @@ -68,8 +68,8 @@ require ( github.com/DataDog/datadog-agent/comp/core/log/mock v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/auditor v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/client v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/diagnostic v0.56.0-rc.3 @@ -80,7 +80,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/status/statusinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/status/health v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.0-rc.3 github.com/stretchr/testify v1.9.0 @@ -92,14 +92,14 @@ require ( github.com/DataDog/agent-payload/v5 v5.0.106 // indirect github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/processor v0.56.0-rc.3 // indirect @@ -108,19 +108,19 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/log/setup v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/utilizationtracker v0.0.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect github.com/DataDog/viper v1.13.5 // indirect diff --git a/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod b/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod index a9f6f44ae44a88..5a27d0b0c54e65 100644 --- a/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod @@ -134,7 +134,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/flare/types v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/log/def v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/def v0.57.1 // indirect @@ -145,13 +145,13 @@ require ( github.com/DataDog/datadog-agent/comp/trace/compression/def v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/aggregator/ckey v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/api v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/logs/auditor v0.56.0-rc.3 // indirect @@ -178,23 +178,23 @@ require ( github.com/DataDog/datadog-agent/pkg/util/buf v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/cgroups v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/common v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/json v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/utilizationtracker v0.0.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.57.1 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.26.0 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod index 2e774f0f4fe005..e80f7a5905191e 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod @@ -47,7 +47,7 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 github.com/stormcat24/protodep v0.1.8 @@ -64,28 +64,28 @@ require ( ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/proto v0.55.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.13.0 // indirect github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 // indirect diff --git a/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod b/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod index 74171b149750e6..66e85d1bb086b2 100644 --- a/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod @@ -95,7 +95,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/flare/builder v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/log/def v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/def v0.57.1 // indirect @@ -104,13 +104,13 @@ require ( github.com/DataDog/datadog-agent/comp/serializer/compression v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/aggregator/ckey v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/api v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.56.0-rc.3 // indirect @@ -121,19 +121,19 @@ require ( github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/buf v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/common v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/json v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.57.1 // indirect github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect github.com/DataDog/sketches-go v1.4.4 // indirect diff --git a/comp/trace/config/setup.go b/comp/trace/config/setup.go index fbfa318e30c726..cdb7d6f9c3064f 100644 --- a/comp/trace/config/setup.go +++ b/comp/trace/config/setup.go @@ -396,8 +396,9 @@ func applyDatadogConfig(c *config.AgentConfig, core corecompcfg.Component) error } c.Obfuscation = new(config.ObfuscationConfig) if core.IsSet("apm_config.obfuscation") { + cfg := pkgconfigsetup.Datadog() var o config.ObfuscationConfig - err := pkgconfigsetup.Datadog().UnmarshalKey("apm_config.obfuscation", &o) + err := structure.UnmarshalKey(cfg, "apm_config.obfuscation", &o) if err == nil { c.Obfuscation = &o if o.RemoveStackTraces { @@ -536,7 +537,8 @@ func applyDatadogConfig(c *config.AgentConfig, core corecompcfg.Component) error "apm_config.trace_writer": c.TraceWriter, "apm_config.stats_writer": c.StatsWriter, } { - if err := pkgconfigsetup.Datadog().UnmarshalKey(key, cfg); err != nil { + ddcfg := pkgconfigsetup.Datadog() + if err := structure.UnmarshalKey(ddcfg, key, cfg); err != nil { log.Errorf("Error reading writer config %q: %v", key, err) } } @@ -556,7 +558,8 @@ func applyDatadogConfig(c *config.AgentConfig, core corecompcfg.Component) error // undocumented deprecated if core.IsSet("apm_config.analyzed_rate_by_service") { rateByService := make(map[string]float64) - if err := pkgconfigsetup.Datadog().UnmarshalKey("apm_config.analyzed_rate_by_service", &rateByService); err != nil { + cfg := pkgconfigsetup.Datadog() + if err := structure.UnmarshalKey(cfg, "apm_config.analyzed_rate_by_service", &rateByService); err != nil { return err } c.AnalyzedRateByServiceLegacy = rateByService diff --git a/go.mod b/go.mod index 51b33deb1d59a3..f91e78d06a0648 100644 --- a/go.mod +++ b/go.mod @@ -157,7 +157,7 @@ require ( github.com/DataDog/datadog-agent/pkg/trace v0.59.0 github.com/DataDog/datadog-agent/pkg/util/cgroups v0.58.1 github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/pointer v0.58.1 + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/datadog-operator v0.7.1-0.20241024104907-734366f3c0d1 @@ -642,7 +642,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/log/impl v0.59.0 github.com/DataDog/datadog-agent/comp/core/log/impl-trace v0.59.0 github.com/DataDog/datadog-agent/comp/core/log/mock v0.58.0-devel - github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0-rc.6 + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 github.com/DataDog/datadog-agent/comp/core/status v0.59.0-rc.6 github.com/DataDog/datadog-agent/comp/core/status/statusimpl v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/core/tagger/tags v0.0.0-00010101000000-000000000000 @@ -672,12 +672,12 @@ require ( github.com/DataDog/datadog-agent/comp/trace/compression/impl-zstd v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/aggregator/ckey v0.59.0-rc.6 github.com/DataDog/datadog-agent/pkg/api v0.57.1 - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0-rc.6 - github.com/DataDog/datadog-agent/pkg/config/env v0.59.0-rc.6 - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.1 - github.com/DataDog/datadog-agent/pkg/config/model v0.59.0-rc.6 + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/config/remote v0.59.0-rc.5 - github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0-rc.6 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/config/utils v0.58.1 github.com/DataDog/datadog-agent/pkg/errors v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/auditor v0.58.1 @@ -707,8 +707,8 @@ require ( github.com/DataDog/datadog-agent/pkg/util/cache v0.59.0-rc.5 github.com/DataDog/datadog-agent/pkg/util/common v0.59.0 github.com/DataDog/datadog-agent/pkg/util/containers/image v0.56.2 - github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0-rc.6 - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0-rc.6 + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 github.com/DataDog/datadog-agent/pkg/util/flavor v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.59.0 github.com/DataDog/datadog-agent/pkg/util/grpc v0.59.0 @@ -792,7 +792,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/status/statusinterface v0.58.1 // indirect github.com/DataDog/datadog-agent/pkg/util/buf v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.58.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.58.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.31.0 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 // indirect diff --git a/pkg/api/go.mod b/pkg/api/go.mod index 45bd6d64886591..0b901a2db57b96 100644 --- a/pkg/api/go.mod +++ b/pkg/api/go.mod @@ -17,6 +17,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/model => ../config/model github.com/DataDog/datadog-agent/pkg/config/nodetreemodel => ../../pkg/config/nodetreemodel github.com/DataDog/datadog-agent/pkg/config/setup => ../config/setup + github.com/DataDog/datadog-agent/pkg/config/structure => ../../pkg/config/structure github.com/DataDog/datadog-agent/pkg/config/teeconfig => ../../pkg/config/teeconfig github.com/DataDog/datadog-agent/pkg/config/utils => ../config/utils github.com/DataDog/datadog-agent/pkg/telemetry => ../telemetry @@ -38,33 +39,34 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/core/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel - github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/system v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 github.com/stretchr/testify v1.9.0 ) require ( github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/pkg/collector/python/datadog_agent.go b/pkg/collector/python/datadog_agent.go index b4528fd05966ee..95a0b2f69f19d0 100644 --- a/pkg/collector/python/datadog_agent.go +++ b/pkg/collector/python/datadog_agent.go @@ -22,6 +22,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/collector/check" "github.com/DataDog/datadog-agent/pkg/collector/externalhost" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/config/structure" "github.com/DataDog/datadog-agent/pkg/obfuscate" "github.com/DataDog/datadog-agent/pkg/persistentcache" "github.com/DataDog/datadog-agent/pkg/util" @@ -253,7 +254,7 @@ var ( func lazyInitObfuscator() *obfuscate.Obfuscator { obfuscatorLoader.Do(func() { var cfg obfuscate.Config - if err := pkgconfigsetup.Datadog().UnmarshalKey("apm_config.obfuscation", &cfg); err != nil { + if err := structure.UnmarshalKey(pkgconfigsetup.Datadog(), "apm_config.obfuscation", &cfg); err != nil { log.Errorf("Failed to unmarshal apm_config.obfuscation: %s", err.Error()) cfg = obfuscate.Config{} } diff --git a/pkg/config/model/viper_test.go b/pkg/config/model/viper_test.go index c8d4d7de36fc28..7babb3453ffbe0 100644 --- a/pkg/config/model/viper_test.go +++ b/pkg/config/model/viper_test.go @@ -61,6 +61,7 @@ func TestConcurrencyUnmarshalling(t *testing.T) { go func() { defer wg.Done() for n := 0; n <= 1000; n++ { + // TODO: This should use pkg/config/structure.UnmarshalKey but that creates a circular dependency. err := config.UnmarshalKey("foo", &s) if err != nil { errs <- fmt.Errorf("unable to decode into struct, %w", err) diff --git a/pkg/config/remote/go.mod b/pkg/config/remote/go.mod index a0ed4243493f6a..4a0ed02d3a50c0 100644 --- a/pkg/config/remote/go.mod +++ b/pkg/config/remote/go.mod @@ -43,14 +43,14 @@ replace ( ) require ( - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel - github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/grpc v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/uuid v0.56.0-rc.3 github.com/Masterminds/semver v1.5.0 github.com/benbjohnson/clock v1.3.0 @@ -65,24 +65,25 @@ require ( require ( github.com/DataDog/appsec-internal-go v1.7.0 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/api v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/obfuscate v0.48.0 // indirect github.com/DataDog/datadog-agent/pkg/util/cache v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/datadog-go/v5 v5.5.0 // indirect github.com/DataDog/go-libddwaf/v3 v3.3.0 // indirect @@ -116,7 +117,7 @@ require ( ) require ( - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 github.com/DataDog/viper v1.13.5 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect @@ -147,3 +148,5 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/config/structure => ../structure diff --git a/pkg/config/setup/config.go b/pkg/config/setup/config.go index d156d6fec9e9e0..ae72d5086ad2b5 100644 --- a/pkg/config/setup/config.go +++ b/pkg/config/setup/config.go @@ -1708,6 +1708,7 @@ func LoadProxyFromEnv(config pkgconfigmodel.Config) { var isSet bool p := &pkgconfigmodel.Proxy{} if isSet = config.IsSet("proxy"); isSet { + // TODO: This should use pkg/config/structure.UnmarshalKey but that creates a circular dependency. if err := config.UnmarshalKey("proxy", p); err != nil { isSet = false log.Errorf("Could not load proxy setting from the configuration (ignoring): %s", err) @@ -2469,6 +2470,7 @@ func IsCLCRunner(config pkgconfigmodel.Reader) bool { } var cps []ConfigurationProviders + // TODO: This should use pkg/config/structure.UnmarshalKey but that creates a circular dependency. if err := config.UnmarshalKey("config_providers", &cps); err != nil { return false } diff --git a/pkg/config/structure/go.mod b/pkg/config/structure/go.mod index 7681e588f36c13..16a8d44e24545a 100644 --- a/pkg/config/structure/go.mod +++ b/pkg/config/structure/go.mod @@ -34,6 +34,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/mock v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 + github.com/DataDog/viper v1.13.5 github.com/spf13/cast v1.5.1 github.com/stretchr/testify v1.9.0 ) @@ -54,7 +55,6 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/pkg/config/structure/unmarshal.go b/pkg/config/structure/unmarshal.go index 22ebd2f1595bfe..a20eb59358df73 100644 --- a/pkg/config/structure/unmarshal.go +++ b/pkg/config/structure/unmarshal.go @@ -16,6 +16,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/config/model" "github.com/DataDog/datadog-agent/pkg/config/nodetreemodel" + "github.com/DataDog/viper" "github.com/spf13/cast" ) @@ -23,6 +24,7 @@ import ( type featureSet struct { allowSquash bool convertEmptyStrNil bool + convertArrayToMap bool } // UnmarshalKeyOption is an option that affects the enabled features in UnmarshalKey @@ -39,6 +41,28 @@ var ConvertEmptyStringToNil UnmarshalKeyOption = func(fs *featureSet) { fs.convertEmptyStrNil = true } +// ImplicitlyConvertArrayToMapSet allows UnmarshalKey to implicitly convert an array of []interface{} to a map[interface{}]bool +var ImplicitlyConvertArrayToMapSet UnmarshalKeyOption = func(fs *featureSet) { + fs.convertArrayToMap = true +} + +// legacyConvertArrayToMap convert array to map when DD_CONF_NODETREEMODEL is disabled +var legacyConvertArrayToMap = viper.DecodeHook( + func(rf reflect.Kind, rt reflect.Kind, data interface{}) (interface{}, error) { + if rf != reflect.Slice { + return data, nil + } + if rt != reflect.Map { + return data, nil + } + newData := map[interface{}]bool{} + for _, i := range data.([]interface{}) { + newData[i] = true + } + return newData, nil + }, +) + // UnmarshalKey retrieves data from the config at the given key and deserializes it // to be stored on the target struct. // @@ -51,6 +75,15 @@ func UnmarshalKey(cfg model.Reader, key string, target interface{}, opts ...Unma if nodetreemodel == "enabled" || nodetreemodel == "unmarshal" { return unmarshalKeyReflection(cfg, key, target, opts...) } + + fs := &featureSet{} + for _, o := range opts { + o(fs) + } + + if fs.convertArrayToMap { + return cfg.UnmarshalKey(key, target, legacyConvertArrayToMap) + } return cfg.UnmarshalKey(key, target) } @@ -163,25 +196,38 @@ func copyStruct(target reflect.Value, source nodetreemodel.Node, fs *featureSet) return nil } -func copyMap(target reflect.Value, source nodetreemodel.Node, _ *featureSet) error { - ktype := reflect.TypeOf("") - vtype := reflect.TypeOf("") - - // TODO: Should handle maps with more complex types in a future PR - // - // For now we only support map[string]string. - if target.Type().Elem() != vtype || target.Type().Key() != ktype { - return fmt.Errorf("only map[string]string are supported, not %s", target.Type()) - } - +func copyMap(target reflect.Value, source nodetreemodel.Node, fs *featureSet) error { + ktype := target.Type().Key() + vtype := target.Type().Elem() mtype := reflect.MapOf(ktype, vtype) results := reflect.MakeMap(mtype) + if fs.convertArrayToMap { + if leaf, ok := source.(nodetreemodel.LeafNode); ok { + thing := leaf.Get() + if arr, ok := thing.([]interface{}); ok { + // convert []interface{} to map[interface{}]bool + create := make(map[interface{}]bool) + for k := range len(arr) { + item := arr[k] + create[fmt.Sprintf("%s", item)] = true + } + converted, err := nodetreemodel.NewNodeTree(create, model.SourceUnknown) + if err != nil { + return err + } + source = converted + } + } + } + inner, ok := source.(nodetreemodel.InnerNode) if !ok { - return fmt.Errorf("can't copy a map into a leaf") + return fmt.Errorf("cannot assign leaf node to a map") } - for _, mkey := range inner.ChildrenKeys() { + + mapKeys := inner.ChildrenKeys() + for _, mkey := range mapKeys { child, err := inner.GetChild(mkey) if err != nil { return err @@ -190,10 +236,12 @@ func copyMap(target reflect.Value, source nodetreemodel.Node, _ *featureSet) err continue } if scalar, ok := child.(nodetreemodel.LeafNode); ok { - if mval, err := cast.ToStringE(scalar.Get()); err == nil { + if mval, err := cast.ToStringE(scalar.Get()); vtype == reflect.TypeOf("") && err == nil { results.SetMapIndex(reflect.ValueOf(mkey), reflect.ValueOf(mval)) + } else if bval, err := cast.ToBoolE(scalar.Get()); vtype == reflect.TypeOf(true) && err == nil { + results.SetMapIndex(reflect.ValueOf(mkey), reflect.ValueOf(bval)) } else { - return fmt.Errorf("TODO: only map[string]string supported currently") + return fmt.Errorf("only map[string]string and map[string]bool supported currently") } } } diff --git a/pkg/config/structure/unmarshal_test.go b/pkg/config/structure/unmarshal_test.go index 79344e2c7d91c5..4b1733568f272f 100644 --- a/pkg/config/structure/unmarshal_test.go +++ b/pkg/config/structure/unmarshal_test.go @@ -961,22 +961,6 @@ feature: require.Error(t, err) assert.Contains(t, err.Error(), "can't copy into target: scalar required") }) - - t.Run("errors on non-string map", func(t *testing.T) { - confYaml := ` -feature: - enabled: true -` - - mockConfig := mock.NewFromYAML(t, confYaml) - mockConfig.SetKnown("feature") - - feature := make(map[string]bool) - - err := unmarshalKeyReflection(mockConfig, "feature", &feature) - require.Error(t, err) - assert.Equal(t, err.Error(), "only map[string]string are supported, not map[string]bool") - }) } // A flag is provided as a struct tag after a field name separated by a comma that @@ -1231,13 +1215,15 @@ service: }) } -func TestUnmarshalKeysToMap(t *testing.T) { +func TestUnmarshalKeysToMapOfString(t *testing.T) { confYaml := ` service: host: datad0g.com name: intake apikey: abc1 the_great_question: 42 + enabled: true + disabled: f ` mockConfig := mock.NewFromYAML(t, confYaml) mockConfig.SetKnown("service") @@ -1250,6 +1236,31 @@ service: assert.Equal(t, svc["name"], "intake") assert.Equal(t, svc["apikey"], "abc1") assert.Equal(t, svc["the_great_question"], "42") + assert.Equal(t, svc["enabled"], "true") + assert.Equal(t, svc["disabled"], "f") +} + +func TestUnmarshalKeysToMapOfBool(t *testing.T) { + confYaml := ` +service: + enabled: true + disabled: false +` + mockConfig := mock.NewFromYAML(t, confYaml) + mockConfig.SetKnown("service") + var svc = make(map[string]bool) + + err := unmarshalKeyReflection(mockConfig, "service", &svc) + assert.NoError(t, err) + + assert.Equal(t, svc["enabled"], true) + assert.Equal(t, svc["disabled"], false) + + err = UnmarshalKey(mockConfig, "service", &svc) + assert.NoError(t, err) + + assert.Equal(t, svc["enabled"], true) + assert.Equal(t, svc["disabled"], false) } func TestMapGetChildNotFound(t *testing.T) { diff --git a/pkg/config/utils/go.mod b/pkg/config/utils/go.mod index e94371298e41ba..fb3ae2aab408bf 100644 --- a/pkg/config/utils/go.mod +++ b/pkg/config/utils/go.mod @@ -15,6 +15,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/model => ../model/ github.com/DataDog/datadog-agent/pkg/config/nodetreemodel => ../../../pkg/config/nodetreemodel github.com/DataDog/datadog-agent/pkg/config/setup => ../setup/ + github.com/DataDog/datadog-agent/pkg/config/structure => ../../../pkg/config/structure github.com/DataDog/datadog-agent/pkg/config/teeconfig => ../../../pkg/config/teeconfig github.com/DataDog/datadog-agent/pkg/telemetry => ../../telemetry github.com/DataDog/datadog-agent/pkg/util/executable => ../../util/executable @@ -33,29 +34,30 @@ replace ( ) require ( - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel - github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/setup v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 github.com/stretchr/testify v1.9.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect diff --git a/pkg/config/utils/metadata_providers.go b/pkg/config/utils/metadata_providers.go index ca2d3b01e46a81..113611f5e4196d 100644 --- a/pkg/config/utils/metadata_providers.go +++ b/pkg/config/utils/metadata_providers.go @@ -9,6 +9,7 @@ import ( "time" pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model" + "github.com/DataDog/datadog-agent/pkg/config/structure" ) // MetadataProviders helps unmarshalling `metadata_providers` config param @@ -20,5 +21,5 @@ type MetadataProviders struct { // GetMetadataProviders returns the "metadata_providers" set in the configuration func GetMetadataProviders(c pkgconfigmodel.Reader) ([]MetadataProviders, error) { var mp []MetadataProviders - return mp, c.UnmarshalKey("metadata_providers", &mp) + return mp, structure.UnmarshalKey(c, "metadata_providers", &mp) } diff --git a/pkg/logs/auditor/go.mod b/pkg/logs/auditor/go.mod index 714abc3ee10a39..97112b7a6f7b09 100644 --- a/pkg/logs/auditor/go.mod +++ b/pkg/logs/auditor/go.mod @@ -43,34 +43,34 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/status/health v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/stretchr/testify v1.9.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/pkg/logs/client/go.mod b/pkg/logs/client/go.mod index 033ccf1a1f5e9f..2a724520207cea 100644 --- a/pkg/logs/client/go.mod +++ b/pkg/logs/client/go.mod @@ -50,8 +50,8 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/metrics v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 @@ -60,36 +60,36 @@ require ( github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 github.com/stretchr/testify v1.9.0 golang.org/x/net v0.31.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/utilizationtracker v0.0.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect diff --git a/pkg/logs/diagnostic/go.mod b/pkg/logs/diagnostic/go.mod index 3238be81ac26d7..871e750da65e88 100644 --- a/pkg/logs/diagnostic/go.mod +++ b/pkg/logs/diagnostic/go.mod @@ -46,35 +46,35 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 github.com/stretchr/testify v1.9.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/pkg/logs/internal/decoder/auto_multiline_detection/user_samples.go b/pkg/logs/internal/decoder/auto_multiline_detection/user_samples.go index 0639c6641cc3e4..ee750936c85a82 100644 --- a/pkg/logs/internal/decoder/auto_multiline_detection/user_samples.go +++ b/pkg/logs/internal/decoder/auto_multiline_detection/user_samples.go @@ -10,6 +10,7 @@ import ( "regexp" "github.com/DataDog/datadog-agent/pkg/config/model" + "github.com/DataDog/datadog-agent/pkg/config/structure" "github.com/DataDog/datadog-agent/pkg/logs/internal/decoder/auto_multiline_detection/tokens" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -46,7 +47,7 @@ type UserSamples struct { func NewUserSamples(config model.Reader) *UserSamples { tokenizer := NewTokenizer(0) s := make([]*UserSample, 0) - err := config.UnmarshalKey("logs_config.auto_multi_line_detection_custom_samples", &s) + err := structure.UnmarshalKey(config, "logs_config.auto_multi_line_detection_custom_samples", &s) if err != nil { log.Error("Failed to unmarshal custom samples: ", err) diff --git a/pkg/logs/message/go.mod b/pkg/logs/message/go.mod index 69e65223a97e31..59c223b723d2e1 100644 --- a/pkg/logs/message/go.mod +++ b/pkg/logs/message/go.mod @@ -42,31 +42,31 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/stretchr/testify v1.9.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/pkg/logs/pipeline/go.mod b/pkg/logs/pipeline/go.mod index 0bfed8fb6ce9a8..1f891bb34d799b 100644 --- a/pkg/logs/pipeline/go.mod +++ b/pkg/logs/pipeline/go.mod @@ -59,8 +59,8 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/auditor v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/client v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/diagnostic v0.56.0-rc.3 @@ -71,7 +71,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/sender v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/status/statusinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/status/health v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 github.com/hashicorp/go-multierror v1.1.1 github.com/stretchr/testify v1.9.0 @@ -80,32 +80,32 @@ require ( require ( github.com/DataDog/agent-payload/v5 v5.0.106 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/utilizationtracker v0.0.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect github.com/DataDog/viper v1.13.5 // indirect diff --git a/pkg/logs/processor/go.mod b/pkg/logs/processor/go.mod index b04bace79d3b65..8893206f0a5507 100644 --- a/pkg/logs/processor/go.mod +++ b/pkg/logs/processor/go.mod @@ -51,41 +51,41 @@ require ( github.com/DataDog/agent-payload/v5 v5.0.106 github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/diagnostic v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/metrics v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sds v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/stretchr/testify v1.9.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/utilizationtracker v0.0.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect github.com/DataDog/viper v1.13.5 // indirect diff --git a/pkg/logs/sds/go.mod b/pkg/logs/sds/go.mod index 538d2100333e0f..b1d5763384e06d 100644 --- a/pkg/logs/sds/go.mod +++ b/pkg/logs/sds/go.mod @@ -49,39 +49,39 @@ replace ( ) require ( - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 github.com/stretchr/testify v1.9.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/pkg/logs/sender/go.mod b/pkg/logs/sender/go.mod index e471e3285c0009..f3b64ee87a3204 100644 --- a/pkg/logs/sender/go.mod +++ b/pkg/logs/sender/go.mod @@ -51,45 +51,45 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/client v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/metrics v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/status/statusinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/benbjohnson/clock v1.3.5 github.com/stretchr/testify v1.9.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/utilizationtracker v0.0.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/pkg/logs/sources/go.mod b/pkg/logs/sources/go.mod index 7c0b5b8584a46e..05a3f9c7c32236 100644 --- a/pkg/logs/sources/go.mod +++ b/pkg/logs/sources/go.mod @@ -41,30 +41,30 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 github.com/stretchr/testify v1.9.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/pkg/logs/util/testutils/go.mod b/pkg/logs/util/testutils/go.mod index 157c9878edab81..c42841ad97fe46 100644 --- a/pkg/logs/util/testutils/go.mod +++ b/pkg/logs/util/testutils/go.mod @@ -44,28 +44,28 @@ replace ( require github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect diff --git a/pkg/network/config/replace_rules.go b/pkg/network/config/replace_rules.go index ce8e1654766f0e..834e28c3ed3881 100644 --- a/pkg/network/config/replace_rules.go +++ b/pkg/network/config/replace_rules.go @@ -12,6 +12,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/config/model" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/config/structure" ) // ReplaceRule specifies a replace rule. @@ -32,7 +33,7 @@ func parseReplaceRules(cfg model.Config, key string) ([]*ReplaceRule, error) { } rules := make([]*ReplaceRule, 0) - if err := cfg.UnmarshalKey(key, &rules); err != nil { + if err := structure.UnmarshalKey(cfg, key, &rules); err != nil { return nil, fmt.Errorf("rules format should be of the form '[{\"pattern\":\"pattern\",\"repl\":\"replace_str\"}]', error: %w", err) } diff --git a/pkg/serializer/go.mod b/pkg/serializer/go.mod index 35b6c053806584..1ddabf44a07a1e 100644 --- a/pkg/serializer/go.mod +++ b/pkg/serializer/go.mod @@ -69,15 +69,15 @@ require ( github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/serializer/compression v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/aggregator/ckey v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/metrics v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/process/util/api v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/tagger/types v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/tagset v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/json v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/version v0.57.1 github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 github.com/gogo/protobuf v1.3.2 @@ -92,16 +92,16 @@ require ( github.com/DataDog/datadog-agent/comp/core/flare/builder v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/log/def v0.0.0-00010101000000-000000000000 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/def v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/api v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.56.0-rc.3 // indirect @@ -109,18 +109,18 @@ require ( github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/buf v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/common v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect github.com/DataDog/sketches-go v1.4.4 // indirect github.com/DataDog/viper v1.13.5 // indirect diff --git a/pkg/snmp/snmp.go b/pkg/snmp/snmp.go index 6913ae4a866a72..8e63ad76a6d3e7 100644 --- a/pkg/snmp/snmp.go +++ b/pkg/snmp/snmp.go @@ -10,15 +10,14 @@ import ( "fmt" "hash/fnv" "net" - "reflect" "sort" "strconv" "time" - "github.com/DataDog/viper" "github.com/gosnmp/gosnmp" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/config/structure" "github.com/DataDog/datadog-agent/pkg/snmp/gosnmplib" "github.com/DataDog/datadog-agent/pkg/snmp/snmpintegration" @@ -99,33 +98,18 @@ type intOrBoolPtr interface { // NewListenerConfig parses configuration and returns a built ListenerConfig func NewListenerConfig() (ListenerConfig, error) { var snmpConfig ListenerConfig - opt := viper.DecodeHook( - func(rf reflect.Kind, rt reflect.Kind, data interface{}) (interface{}, error) { - // Turn an array into a map for ignored addresses - if rf != reflect.Slice { - return data, nil - } - if rt != reflect.Map { - return data, nil - } - newData := map[interface{}]bool{} - for _, i := range data.([]interface{}) { - newData[i] = true - } - return newData, nil - }, - ) // Set defaults before unmarshalling snmpConfig.CollectDeviceMetadata = true snmpConfig.CollectTopology = true - if pkgconfigsetup.Datadog().IsSet("network_devices.autodiscovery") { - err := pkgconfigsetup.Datadog().UnmarshalKey("network_devices.autodiscovery", &snmpConfig, opt) + ddcfg := pkgconfigsetup.Datadog() + if ddcfg.IsSet("network_devices.autodiscovery") { + err := structure.UnmarshalKey(ddcfg, "network_devices.autodiscovery", &snmpConfig, structure.ImplicitlyConvertArrayToMapSet) if err != nil { return snmpConfig, err } - } else if pkgconfigsetup.Datadog().IsSet("snmp_listener") { - err := pkgconfigsetup.Datadog().UnmarshalKey("snmp_listener", &snmpConfig, opt) + } else if ddcfg.IsSet("snmp_listener") { + err := structure.UnmarshalKey(ddcfg, "snmp_listener", &snmpConfig, structure.ImplicitlyConvertArrayToMapSet) if err != nil { return snmpConfig, err } diff --git a/pkg/snmp/snmpparse/config_snmp.go b/pkg/snmp/snmpparse/config_snmp.go index 13f90a7141e7b1..e544f22e9a7595 100644 --- a/pkg/snmp/snmpparse/config_snmp.go +++ b/pkg/snmp/snmpparse/config_snmp.go @@ -10,17 +10,15 @@ import ( "encoding/json" "errors" "fmt" - yaml "gopkg.in/yaml.v2" "net" "net/url" - "reflect" - - "github.com/DataDog/viper" - apiutil "github.com/DataDog/datadog-agent/pkg/api/util" + yaml "gopkg.in/yaml.v2" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" "github.com/DataDog/datadog-agent/comp/core/config" + apiutil "github.com/DataDog/datadog-agent/pkg/api/util" + "github.com/DataDog/datadog-agent/pkg/config/structure" snmplistener "github.com/DataDog/datadog-agent/pkg/snmp" ) @@ -81,34 +79,18 @@ func ParseConfigSnmp(c integration.Config) []SNMPConfig { } func parseConfigSnmpMain(conf config.Component) ([]SNMPConfig, error) { - var snmpconfigs []SNMPConfig - var configs []snmplistener.Config - opt := viper.DecodeHook( - func(rf reflect.Kind, rt reflect.Kind, data interface{}) (interface{}, error) { - // Turn an array into a map for ignored addresses - if rf != reflect.Slice { - return data, nil - } - if rt != reflect.Map { - return data, nil - } - newData := map[interface{}]bool{} - for _, i := range data.([]interface{}) { - newData[i] = true - } - return newData, nil - }, - ) - // the UnmarshalKey stores the result in mapstructures while the snmpconfig is in yaml - // so for each result of the Unmarshal key we store the result in a tmp SNMPConfig{} object + snmpconfigs := []SNMPConfig{} + configs := []snmplistener.Config{} + //the UnmarshalKey stores the result in mapstructures while the snmpconfig is in yaml + //so for each result of the Unmarshal key we store the result in a tmp SNMPConfig{} object if conf.IsSet("network_devices.autodiscovery.configs") { - err := conf.UnmarshalKey("network_devices.autodiscovery.configs", &configs, opt) + err := structure.UnmarshalKey(conf, "network_devices.autodiscovery.configs", &configs, structure.ImplicitlyConvertArrayToMapSet) if err != nil { fmt.Printf("unable to get snmp config from network_devices.autodiscovery: %v", err) return nil, err } } else if conf.IsSet("snmp_listener.configs") { - err := conf.UnmarshalKey("snmp_listener.configs", &configs, opt) + err := structure.UnmarshalKey(conf, "snmp_listener.configs", &configs, structure.ImplicitlyConvertArrayToMapSet) if err != nil { fmt.Printf("unable to get snmp config from snmp_listener: %v", err) return nil, err diff --git a/pkg/snmp/snmpparse/config_snmp_test.go b/pkg/snmp/snmpparse/config_snmp_test.go index fc2ec479adaaaa..56315ecb45dc53 100644 --- a/pkg/snmp/snmpparse/config_snmp_test.go +++ b/pkg/snmp/snmpparse/config_snmp_test.go @@ -297,7 +297,8 @@ func TestParseConfigSnmpMain(t *testing.T) { fx.Replace(config.MockParams{Overrides: rawConf}), ) - Output, _ := parseConfigSnmpMain(conf) + Output, err := parseConfigSnmpMain(conf) + require.NoError(t, err) Exoutput := []SNMPConfig{ { Version: "1", @@ -337,7 +338,8 @@ network_devices: fx.Replace(config.MockParams{Overrides: rawConf}), ) - Output, _ := parseConfigSnmpMain(conf) + Output, err := parseConfigSnmpMain(conf) + require.NoError(t, err) Exoutput := []SNMPConfig{ { Version: "1", diff --git a/pkg/util/grpc/go.mod b/pkg/util/grpc/go.mod index 023e84c3c7828b..d4f475022ff4c6 100644 --- a/pkg/util/grpc/go.mod +++ b/pkg/util/grpc/go.mod @@ -37,7 +37,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/api v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 github.com/grpc-ecosystem/go-grpc-middleware v1.2.0 github.com/stretchr/testify v1.9.0 @@ -46,23 +46,24 @@ require ( ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/viper v1.13.5 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect @@ -106,3 +107,5 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../config/structure diff --git a/test/otel/go.mod b/test/otel/go.mod index 326e90ea51055d..ea718cbe70eed2 100644 --- a/test/otel/go.mod +++ b/test/otel/go.mod @@ -102,8 +102,8 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.56.0-rc.1 - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.113.0 @@ -119,17 +119,17 @@ require ( github.com/DataDog/agent-payload/v5 v5.0.119 // indirect github.com/DataDog/datadog-agent/comp/core/flare/builder v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.57.1 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/def v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/def v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/logs/auditor v0.56.0-rc.3 // indirect @@ -150,21 +150,21 @@ require ( github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/cgroups v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.58.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.58.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.58.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/utilizationtracker v0.0.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.57.1 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.26.0 // indirect github.com/DataDog/datadog-go/v5 v5.5.0 // indirect