diff --git a/.circleci/config.yml b/.circleci/config.yml index 9ad6aeb1dde6e..97dfcb2d96e42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,7 @@ experimental: templates: job_template: &job_template docker: - - image: gcr.io/datadoghq/agent-circleci-runner:v44534774-f5cc3e24 + - image: gcr.io/datadoghq/agent-circleci-runner:v44808106-d8c4f8af environment: USE_SYSTEM_LIBS: "1" working_directory: /go/src/github.com/DataDog/datadog-agent diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6a3ccefdffee5..4c47f9109d2cf 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -98,7 +98,6 @@ /.gitlab/common/test_infra_version.yml @DataDog/agent-devx-loops @DataDog/agent-devx-infra /.gitlab/e2e/e2e.yml @DataDog/container-integrations @DataDog/agent-devx-loops -/.gitlab/e2e_k8s/e2e_k8s.yml @DataDog/container-integrations @DataDog/agent-devx-loops /.gitlab/e2e/install_packages @DataDog/agent-delivery /.gitlab/container_build/fakeintake.yml @DataDog/agent-e2e-testing @DataDog/agent-devx-loops /.gitlab/binary_build/fakeintake.yml @DataDog/agent-e2e-testing @DataDog/agent-devx-loops @@ -565,10 +564,6 @@ /test/ @DataDog/agent-devx-loops /test/benchmarks/ @DataDog/agent-metrics-logs /test/benchmarks/kubernetes_state/ @DataDog/container-integrations -/test/e2e/ @DataDog/container-integrations @DataDog/agent-security -/test/e2e/cws-tests/ @DataDog/agent-security -/test/e2e/argo-workflows/otlp-workflow.yaml @DataDog/opentelemetry -/test/e2e/containers/otlp_sender/ @DataDog/opentelemetry /test/integration/ @DataDog/container-integrations /test/integration/serverless @DataDog/serverless @Datadog/serverless-aws /test/integration/serverless_perf @DataDog/serverless @Datadog/serverless-aws diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d864fb3478d5..c3d8f10250915 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ --- include: - .gitlab/.pre/cancel-prev-pipelines.yml - - .gitlab/.pre/linters.yml - .gitlab/.pre/test_gitlab_configuration.yml - .gitlab/benchmarks/include.yml - .gitlab/binary_build/include.yml @@ -23,7 +22,6 @@ include: - .gitlab/deps_fetch/deps_fetch.yml - .gitlab/dev_container_deploy/include.yml - .gitlab/e2e/e2e.yml - - .gitlab/e2e_k8s/e2e_k8s.yml - .gitlab/e2e_install_packages/include.yml - .gitlab/e2e_pre_test/e2e_pre_test.yml - .gitlab/fips_compliance/fips_compliance_e2e.yml @@ -37,6 +35,7 @@ include: - .gitlab/kitchen_cleanup/include.yml - .gitlab/kitchen_deploy/kitchen_deploy.yml - .gitlab/kitchen_testing/include.yml + - .gitlab/lint/include.yml - .gitlab/maintenance_jobs/include.yml - .gitlab/notify/notify.yml - .gitlab/package_build/include.yml @@ -67,6 +66,7 @@ stages: - maintenance_jobs - deps_build - deps_fetch + - lint - source_test - source_test_stats - software_composition_analysis @@ -796,6 +796,7 @@ workflow: paths: - test/new-e2e/pkg/**/* - test/new-e2e/go.mod + - flakes.yaml compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916 .on_e2e_or_windows_installer_changes: @@ -1034,6 +1035,15 @@ workflow: - when: manual allow_failure: true +.on_cspm_or_e2e_changes: + - !reference [.on_e2e_main_release_or_rc] + - changes: + paths: + - pkg/security/**/* + - test/new-e2e/tests/cspm/**/* #TODO: Add other paths that should trigger the execution of CSPM e2e tests + compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916 + when: on_success + .on_windows_systemprobe_or_e2e_changes: - !reference [.on_e2e_main_release_or_rc] - changes: diff --git a/.gitlab/e2e/e2e.yml b/.gitlab/e2e/e2e.yml index 985274966430d..b0d1bc93e9427 100644 --- a/.gitlab/e2e/e2e.yml +++ b/.gitlab/e2e/e2e.yml @@ -463,6 +463,19 @@ new-e2e-package-signing-suse-a7-x86_64: - .new-e2e_package_signing rules: !reference [.on_default_new_e2e_tests] +new-e2e-cspm: + extends: .new_e2e_template + rules: + - !reference [.on_cspm_or_e2e_changes] + - !reference [.manual] + needs: + - !reference [.needs_new_e2e_template] + - qa_agent + - qa_dca + variables: + TARGETS: ./tests/cspm + TEAM: cspm + generate-flakes-finder-pipeline: image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES stage: e2e diff --git a/.gitlab/e2e_k8s/e2e_k8s.yml b/.gitlab/e2e_k8s/e2e_k8s.yml deleted file mode 100644 index 45ffd2171a413..0000000000000 --- a/.gitlab/e2e_k8s/e2e_k8s.yml +++ /dev/null @@ -1,70 +0,0 @@ - ---- -# e2e stage -# Jobs with the k8s_e2e template - -.k8s_e2e_template: - stage: e2e_k8s - image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES - tags: ["arch:amd64"] - dependencies: [] - variables: - LANG: C.UTF-8 - before_script: - - DOCKER_REGISTRY_LOGIN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $DOCKER_REGISTRY_LOGIN) || exit $?; export DOCKER_REGISTRY_LOGIN - - DOCKER_REGISTRY_PWD=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $DOCKER_REGISTRY_PWD) || exit $?; export DOCKER_REGISTRY_PWD - - DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_DDDEV) || exit $?; export DD_API_KEY - -.k8s-e2e-cws-cspm-init: - - set +x - - export DATADOG_AGENT_SITE=datadoghq.com - - DATADOG_AGENT_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_API_KEY) || exit $?; export DATADOG_AGENT_API_KEY - - DATADOG_AGENT_APP_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_APP_KEY) || exit $?; export DATADOG_AGENT_APP_KEY - - DATADOG_AGENT_RC_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_TESTS_RC_KEY) || exit $?; export DATADOG_AGENT_RC_KEY - -.k8s_e2e_template_needs_dev: - extends: .k8s_e2e_template - needs: - - dev_branch_multiarch-a7 - - dca_dev_branch - -.k8s_e2e_template_dev: - extends: .k8s_e2e_template_needs_dev - script: - - inv -e e2e-tests --agent-image=datadog/agent-dev:${CI_COMMIT_REF_SLUG}-py3 --dca-image=datadog/cluster-agent-dev:${CI_COMMIT_REF_SLUG} --argo-workflow=$ARGO_WORKFLOW - -.k8s_e2e_template_dev_with_cws_cspm_init: - extends: .k8s_e2e_template_needs_dev - script: - - !reference [.k8s-e2e-cws-cspm-init] - - inv -e e2e-tests --agent-image=datadog/agent-dev:${CI_COMMIT_REF_SLUG}-py3 --dca-image=datadog/cluster-agent-dev:${CI_COMMIT_REF_SLUG} --argo-workflow=$ARGO_WORKFLOW - -.k8s_e2e_template_needs_main: - extends: .k8s_e2e_template - needs: - - dev_master-a7 - - dca_dev_master - -.k8s_e2e_template_main_with_cws_cspm_init: - extends: .k8s_e2e_template_needs_main - script: - - !reference [.k8s-e2e-cws-cspm-init] - - inv -e e2e-tests --agent-image=datadog/agent-dev:master-py3 --dca-image=datadog/cluster-agent-dev:master --argo-workflow=$ARGO_WORKFLOW - -.k8s_e2e_template_main: - extends: .k8s_e2e_template_needs_main - script: - - inv -e e2e-tests --agent-image=datadog/agent-dev:master-py3 --dca-image=datadog/cluster-agent-dev:master --argo-workflow=$ARGO_WORKFLOW - -k8s-e2e-cspm-dev: - extends: .k8s_e2e_template_dev_with_cws_cspm_init - rules: !reference [.on_dev_branch_manual] - variables: - ARGO_WORKFLOW: cspm - -k8s-e2e-cspm-main: - extends: .k8s_e2e_template_main_with_cws_cspm_init - rules: !reference [.on_main] - retry: 1 - variables: - ARGO_WORKFLOW: cspm diff --git a/.gitlab/functional_test/regression_detector.yml b/.gitlab/functional_test/regression_detector.yml index e0da62daac673..5980b15df1ef5 100644 --- a/.gitlab/functional_test/regression_detector.yml +++ b/.gitlab/functional_test/regression_detector.yml @@ -14,7 +14,9 @@ single-machine-performance-regression_detector: - submission_metadata # for provenance, debugging - ${CI_COMMIT_SHA}-baseline_sha # for provenance, debugging - outputs/report.md # for debugging, also on S3 - - outputs/report.html # for debugging, also on S3 + - outputs/regression_signal.json # for debugging, also on S3 + - outputs/bounds_check_signal.json # for debugging, also on S3 + - outputs/junit.xml # for debugging, also on S3 when: always variables: SMP_VERSION: 0.16.0 @@ -33,7 +35,6 @@ single-machine-performance-regression_detector: # Ensure output files exist for artifact downloads step - mkdir outputs # Also needed for smp job sync step - touch outputs/report.md # Will be emitted by smp job sync - - touch outputs/report.html # Will be emitted by smp job sync # Compute merge base of current commit and `main` - git fetch origin - SMP_BASE_BRANCH=$(inv release.get-release-json-value base_branch) @@ -95,6 +96,12 @@ single-machine-performance-regression_detector: - !reference [.install_pr_commenter] # Post HTML report to GitHub - cat outputs/report.md | /usr/local/bin/pr-commenter --for-pr="$CI_COMMIT_REF_NAME" --header="Regression Detector" + # Upload JUnit XML outside of Agent CI's tooling because the `junit_upload` + # invoke task has additional logic that does not seem to apply well to SMP's + # JUnit XML. Agent CI seems to use `datadog-agent` as the service name when + # uploading JUnit XML, so the upload command below respects that convention. + - DATADOG_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$API_KEY_ORG2")" || exit $?; export DATADOG_API_KEY + - datadog-ci junit upload --service datadog-agent outputs/junit.xml # Finally, exit 1 if the job signals a regression else 0. - RUST_LOG="${RUST_LOG}" ./smp --team-id ${SMP_AGENT_TEAM_ID} --api-base ${SMP_API} --aws-named-profile ${AWS_NAMED_PROFILE} job result diff --git a/.gitlab/kernel_matrix_testing/common.yml b/.gitlab/kernel_matrix_testing/common.yml index c24969ff08dc5..caf6db59fc284 100644 --- a/.gitlab/kernel_matrix_testing/common.yml +++ b/.gitlab/kernel_matrix_testing/common.yml @@ -142,6 +142,7 @@ KUBERNETES_MEMORY_REQUEST: "12Gi" KUBERNETES_MEMORY_LIMIT: "16Gi" VMCONFIG_FILE: "${CI_PROJECT_DIR}/vmconfig-${CI_PIPELINE_ID}-${ARCH}.json" + EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json before_script: # XXX: system-probe images does not run `entrypoint.sh` which runs `source /root/.bashrc`. # Since the path of Go binary is added into PATH in the bashrc, we need to run it at some point. @@ -151,6 +152,7 @@ - !reference [.retrieve_linux_go_deps] - !reference [.kmt_new_profile] - !reference [.write_ssh_key_file] + - inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH || true script: - echo "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE" > $STACK_DIR - pulumi login $(cat $STACK_DIR | tr -d '\n') @@ -193,6 +195,9 @@ - $CI_PROJECT_DIR/stack.output - $CI_PROJECT_DIR/libvirt - $VMCONFIG_FILE + reports: + annotations: + - $EXTERNAL_LINKS_PATH .kmt_cleanup: stage: kernel_matrix_testing_cleanup diff --git a/.gitlab/lint/include.yml b/.gitlab/lint/include.yml new file mode 100644 index 0000000000000..27676d98eab76 --- /dev/null +++ b/.gitlab/lint/include.yml @@ -0,0 +1,6 @@ +# liont stage +# Include job that run linters on the Agent code. + +include: + - .gitlab/lint/technical_linters.yml + diff --git a/.gitlab/.pre/linters.yml b/.gitlab/lint/technical_linters.yml similarity index 69% rename from .gitlab/.pre/linters.yml rename to .gitlab/lint/technical_linters.yml index 9eaac71010632..099cd975bb8a9 100644 --- a/.gitlab/.pre/linters.yml +++ b/.gitlab/lint/technical_linters.yml @@ -1,14 +1,17 @@ .lint: - stage: .pre + stage: lint image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES tags: ["arch:amd64"] lint_licenses: extends: .lint script: + - !reference [.retrieve_linux_go_deps] + - !reference [.retrieve_linux_go_tools_deps] - inv -e install-tools - inv -e lint-licenses + needs: ["go_tools_deps", "go_deps"] lint_shell: extends: .lint @@ -39,3 +42,23 @@ lint_components: extends: .lint script: - inv -e lint-components lint-fxutil-oneshot-test + + +lint_python: + extends: .lint + needs: [] + script: + - inv -e linter.python + +lint_update_go: + extends: .lint + needs: [] + script: + - inv -e linter.update-go + +validate_modules: + extends: .lint + needs: [] + script: + - inv -e modules.validate + - inv -e modules.validate-used-by-otel diff --git a/.gitlab/package_build/linux.yml b/.gitlab/package_build/linux.yml index 15e66e3eb2d4f..109e78c732537 100644 --- a/.gitlab/package_build/linux.yml +++ b/.gitlab/package_build/linux.yml @@ -1,25 +1,28 @@ +.agent_build_script: + - echo "About to build for $RELEASE_VERSION" + - !reference [.retrieve_linux_go_deps] + - !reference [.cache_omnibus_ruby_deps, setup] + # remove artifacts from previous pipelines that may come from the cache + - rm -rf $OMNIBUS_PACKAGE_DIR/* + # Artifacts and cache must live within project directory but we run omnibus in a neutral directory. + # Thus, we move the artifacts at the end in a gitlab-friendly dir. + - tar -xf $CI_PROJECT_DIR/sysprobe-build-outputs.tar.xz + - mkdir -p /tmp/system-probe + - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/clang-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/clang-bpf + - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/llc-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/llc-bpf + - cp $CI_PROJECT_DIR/minimized-btfs.tar.xz /tmp/system-probe/minimized-btfs.tar.xz + - chmod 0744 /tmp/system-probe/clang-bpf /tmp/system-probe/llc-bpf + - inv -e omnibus.build --fips-mode --release-version "$RELEASE_VERSION" --major-version "$AGENT_MAJOR_VERSION" --python-runtimes "$PYTHON_RUNTIMES" --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --system-probe-bin=/tmp/system-probe --flavor "$FLAVOR" --config-directory "$CONFIG_DIR" --install-directory "$INSTALL_DIR" + - ls -la $OMNIBUS_PACKAGE_DIR + - !reference [.upload_sbom_artifacts] + .agent_build_common: rules: - !reference [.except_mergequeue] - when: on_success stage: package_build script: - - echo "About to build for $RELEASE_VERSION" - - !reference [.retrieve_linux_go_deps] - - !reference [.cache_omnibus_ruby_deps, setup] - # remove artifacts from previous pipelines that may come from the cache - - rm -rf $OMNIBUS_PACKAGE_DIR/* - # Artifacts and cache must live within project directory but we run omnibus in a neutral directory. - # Thus, we move the artifacts at the end in a gitlab-friendly dir. - - tar -xf $CI_PROJECT_DIR/sysprobe-build-outputs.tar.xz - - mkdir -p /tmp/system-probe - - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/clang-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/clang-bpf - - $S3_CP_CMD $S3_PERMANENT_ARTIFACTS_URI/llc-$CLANG_LLVM_VER.${PACKAGE_ARCH} /tmp/system-probe/llc-bpf - - cp $CI_PROJECT_DIR/minimized-btfs.tar.xz /tmp/system-probe/minimized-btfs.tar.xz - - chmod 0744 /tmp/system-probe/clang-bpf /tmp/system-probe/llc-bpf - - inv -e omnibus.build --fips-mode --release-version "$RELEASE_VERSION" --major-version "$AGENT_MAJOR_VERSION" --python-runtimes "$PYTHON_RUNTIMES" --base-dir $OMNIBUS_BASE_DIR ${USE_S3_CACHING} --skip-deps --go-mod-cache="$GOPATH/pkg/mod" --system-probe-bin=/tmp/system-probe --flavor "$FLAVOR" - - ls -la $OMNIBUS_PACKAGE_DIR - - !reference [.upload_sbom_artifacts] + - !reference [.agent_build_script] variables: KUBERNETES_CPU_REQUEST: 16 KUBERNETES_MEMORY_REQUEST: "32Gi" @@ -81,7 +84,37 @@ before_script: - export RELEASE_VERSION=$RELEASE_VERSION_7 -# build Agent 6 binaries for x86_64 +# Temporary custom agent build test to prevent regression +# This test will be removed when custom path are used to build macos agent +# with in-house macos runner builds. +datadog-agent-7-x64-custom-path-test: + extends: [.agent_build_x86, .agent_7_build] + rules: + - !reference [.except_mergequeue] + - when: on_success + stage: package_build + script: + - mkdir /custom + - export CONFIG_DIR="/custom" + - export INSTALL_DIR="/custom/datadog-agent" + - !reference [.agent_build_script] + - ls -la $OMNIBUS_PACKAGE_DIR + - ls -la $INSTALL_DIR + - ls -la /custom/etc + - (ls -la /opt/datadog-agent 2>/dev/null && exit 1) || echo "/opt/datadog-agent has correctly not been generated" + - (ls -la /etc/datadog-agent 2>/dev/null && exit 1) || echo "/etc/datadog-agent has correctly not been generated" + variables: + KUBERNETES_CPU_REQUEST: 16 + KUBERNETES_MEMORY_REQUEST: "32Gi" + KUBERNETES_MEMORY_LIMIT: "32Gi" + artifacts: + expire_in: 2 weeks + paths: + - $OMNIBUS_PACKAGE_DIR + cache: + - !reference [.cache_omnibus_ruby_deps, cache] + + # build Agent 6 binaries for x86_64 datadog-agent-6-x64: extends: [.agent_build_common, .agent_build_x86, .agent_6_build] diff --git a/.gitlab/source_test/include.yml b/.gitlab/source_test/include.yml index c71029608a40e..60666c8d4f5a1 100644 --- a/.gitlab/source_test/include.yml +++ b/.gitlab/source_test/include.yml @@ -12,5 +12,4 @@ include: - .gitlab/source_test/slack.yml - .gitlab/source_test/golang_deps_diff.yml - .gitlab/source_test/notify.yml - - .gitlab/source_test/technical_linters.yml - .gitlab/source_test/tooling_unit_tests.yml diff --git a/.gitlab/source_test/technical_linters.yml b/.gitlab/source_test/technical_linters.yml deleted file mode 100644 index c7759eda331bc..0000000000000 --- a/.gitlab/source_test/technical_linters.yml +++ /dev/null @@ -1,24 +0,0 @@ -lint_python: - stage: source_test - image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES - tags: ["arch:amd64"] - needs: [] - script: - - inv -e linter.python - -lint_update_go: - stage: source_test - image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES - tags: ["arch:amd64"] - needs: [] - script: - - inv -e linter.update-go - -validate_modules: - stage: source_test - image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES - tags: ["arch:amd64"] - needs: [] - script: - - inv -e modules.validate - - inv -e modules.validate-used-by-otel diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4886cd5e1a788..abbc7762d316e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,61 @@ Release Notes ============= +.. _Release Notes_7.57.2: + +7.57.2 +====== + +.. _Release Notes_7.57.2_Prelude: + +Prelude +------- + +Release on: 2024-09-24 + + +.. _Release Notes_7.57.2_Enhancement Notes: + +Enhancement Notes +----------------- + +- Agents are now built with Go ``1.22.7``. + + +.. _Release Notes_7.57.2_Bug Fixes: + +Bug Fixes +--------- + +- Fix OOM error with cluster agent auto instrumentation by increasing default memory request from 20Mi to 100Mi. + +- Fixes a panic caused by running the Agent on readonly filesystems. The + Agent returns integration launchers and handles memory gracefully. + + +.. _Release Notes_7.57.1: + +7.57.1 +====== + +.. _Release Notes_7.57.1_Prelude: + +Prelude +------- + +Release on: 2024-09-17 + +- Please refer to the `7.57.1 tag on integrations-core `_ for the list of changes on the Core Checks + +.. _Release Notes_7.57.1_Bug Fixes: + +Bug Fixes +--------- + +- APM: When the UDS listener cannot be created on the trace-agent, the process will log the error, instead of crashing. +- Fixes memory leak caused by container check. + + .. _Release Notes_7.57.0: 7.57.0 diff --git a/cmd/agent/common/autodiscovery.go b/cmd/agent/common/autodiscovery.go index d20065de8d2f8..8ff855aeca19f 100644 --- a/cmd/agent/common/autodiscovery.go +++ b/cmd/agent/common/autodiscovery.go @@ -23,6 +23,7 @@ import ( confad "github.com/DataDog/datadog-agent/pkg/config/autodiscovery" pkgconfigenv "github.com/DataDog/datadog-agent/pkg/config/env" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/config/structure" "github.com/DataDog/datadog-agent/pkg/util/jsonquery" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -62,7 +63,7 @@ func setupAutoDiscovery(confSearchPaths []string, wmeta workloadmeta.Component, // Register additional configuration providers var configProviders []pkgconfigsetup.ConfigurationProviders var uniqueConfigProviders map[string]pkgconfigsetup.ConfigurationProviders - err := pkgconfigsetup.Datadog().UnmarshalKey("config_providers", &configProviders) + err := structure.UnmarshalKey(pkgconfigsetup.Datadog(), "config_providers", &configProviders) if err == nil { uniqueConfigProviders = make(map[string]pkgconfigsetup.ConfigurationProviders, len(configProviders)+len(extraEnvProviders)+len(configProviders)) @@ -125,7 +126,7 @@ func setupAutoDiscovery(confSearchPaths []string, wmeta workloadmeta.Component, } var listeners []pkgconfigsetup.Listeners - err = pkgconfigsetup.Datadog().UnmarshalKey("listeners", &listeners) + err = structure.UnmarshalKey(pkgconfigsetup.Datadog(), "listeners", &listeners) if err == nil { // Add extra listeners for _, name := range pkgconfigsetup.Datadog().GetStringSlice("extra_listeners") { diff --git a/cmd/serverless-init/cloudservice/cloudrun.go b/cmd/serverless-init/cloudservice/cloudrun.go index d664fb2f7cc93..120f3725367b8 100644 --- a/cmd/serverless-init/cloudservice/cloudrun.go +++ b/cmd/serverless-init/cloudservice/cloudrun.go @@ -6,21 +6,28 @@ package cloudservice import ( + "fmt" + "github.com/DataDog/datadog-agent/pkg/util/log" "os" "github.com/DataDog/datadog-agent/cmd/serverless-init/cloudservice/helper" ) const ( - revisionNameEnvVar = "K_REVISION" //nolint:revive // TODO(SERV) Fix revive linter - ServiceNameEnvVar = "K_SERVICE" + revisionNameEnvVar = "K_REVISION" + ServiceNameEnvVar = "K_SERVICE" // ServiceNameEnvVar is also used in the trace package + configurationNameEnvVar = "K_CONFIGURATION" + functionTypeEnvVar = "FUNCTION_SIGNATURE_TYPE" + functionTargetEnvVar = "FUNCTION_TARGET" // exists as a cloudrunfunction env var for all runtimes except Go ) var metadataHelperFunc = helper.GetMetaData // CloudRun has helper functions for getting Google Cloud Run data -type CloudRun struct{} +type CloudRun struct { + cloudRunFunctionMode bool +} // GetTags returns a map of gcp-related tags. func (c *CloudRun) GetTags() map[string]string { @@ -28,6 +35,7 @@ func (c *CloudRun) GetTags() map[string]string { revisionName := os.Getenv(revisionNameEnvVar) serviceName := os.Getenv(ServiceNameEnvVar) + configName := os.Getenv(configurationNameEnvVar) if revisionName != "" { tags["revision_name"] = revisionName @@ -37,21 +45,48 @@ func (c *CloudRun) GetTags() map[string]string { tags["service_name"] = serviceName } + if configName != "" { + tags["configuration_name"] = configName + } + + if c.cloudRunFunctionMode { + tags = getFunctionTags(tags) + } tags["origin"] = c.GetOrigin() tags["_dd.origin"] = c.GetOrigin() return tags } +func getFunctionTags(tags map[string]string) map[string]string { + functionTarget := os.Getenv(functionTargetEnvVar) + functionSignatureType := os.Getenv(functionTypeEnvVar) + + if functionTarget != "" { + tags["function_target"] = functionTarget + } + + if functionSignatureType != "" { + tags["function_signature_type"] = functionSignatureType + } + return tags +} + // GetOrigin returns the `origin` attribute type for the given // cloud service. func (c *CloudRun) GetOrigin() string { + if c.cloudRunFunctionMode { + return "cloudfunctions" + } return "cloudrun" } // GetPrefix returns the prefix that we're prefixing all // metrics with. func (c *CloudRun) GetPrefix() string { + if c.cloudRunFunctionMode { + return "gcp.cloudfunctions" + } return "gcp.run" } @@ -64,3 +99,9 @@ func isCloudRunService() bool { _, exists := os.LookupEnv(ServiceNameEnvVar) return exists } + +func isCloudRunFunction() bool { + _, cloudRunFunctionMode := os.LookupEnv(functionTargetEnvVar) + log.Debug(fmt.Sprintf("cloud function mode SET TO: %t", cloudRunFunctionMode)) + return cloudRunFunctionMode +} diff --git a/cmd/serverless-init/cloudservice/cloudrun_test.go b/cmd/serverless-init/cloudservice/cloudrun_test.go index 4832b30f48478..41babaa632a1c 100644 --- a/cmd/serverless-init/cloudservice/cloudrun_test.go +++ b/cmd/serverless-init/cloudservice/cloudrun_test.go @@ -78,3 +78,45 @@ func TestGetCloudRunTagsWithEnvironmentVariables(t *testing.T) { "_dd.origin": "cloudrun", }, tags) } + +func TestGetCloudRunFunctionTagsWithEnvironmentVariables(t *testing.T) { + service := &CloudRun{cloudRunFunctionMode: true} + + metadataHelperFunc = func(*helper.GCPConfig) *helper.GCPMetadata { + return &helper.GCPMetadata{ + ContainerID: &helper.Info{ + TagName: "container_id", + Value: "test_container", + }, + Region: &helper.Info{ + TagName: "region", + Value: "test_region", + }, + ProjectID: &helper.Info{ + TagName: "project_id", + Value: "test_project", + }, + } + } + + t.Setenv("K_SERVICE", "test_service") + t.Setenv("K_REVISION", "test_revision") + t.Setenv("K_CONFIGURATION", "test_config") + t.Setenv("FUNCTION_SIGNATURE_TYPE", "test_signature") + t.Setenv("FUNCTION_TARGET", "test_target") + + tags := service.GetTags() + + assert.Equal(t, map[string]string{ + "container_id": "test_container", + "region": "test_region", + "origin": "cloudfunctions", + "project_id": "test_project", + "service_name": "test_service", + "revision_name": "test_revision", + "configuration_name": "test_config", + "_dd.origin": "cloudfunctions", + "function_target": "test_target", + "function_signature_type": "test_signature", + }, tags) +} diff --git a/cmd/serverless-init/cloudservice/service.go b/cmd/serverless-init/cloudservice/service.go index 0449d28d51533..54c9a3576a35a 100644 --- a/cmd/serverless-init/cloudservice/service.go +++ b/cmd/serverless-init/cloudservice/service.go @@ -51,6 +51,9 @@ func (l *LocalService) Init() error { //nolint:revive // TODO(SERV) Fix revive linter func GetCloudServiceType() CloudService { if isCloudRunService() { + if isCloudRunFunction() { + return &CloudRun{cloudRunFunctionMode: true} + } return &CloudRun{} } diff --git a/cmd/serverless/dependencies_linux_amd64.txt b/cmd/serverless/dependencies_linux_amd64.txt index 49b203d78e848..0953b2963a9db 100644 --- a/cmd/serverless/dependencies_linux_amd64.txt +++ b/cmd/serverless/dependencies_linux_amd64.txt @@ -144,6 +144,7 @@ github.com/DataDog/datadog-agent/pkg/config/model github.com/DataDog/datadog-agent/pkg/config/remote/data github.com/DataDog/datadog-agent/pkg/config/setup github.com/DataDog/datadog-agent/pkg/config/setup/constants +github.com/DataDog/datadog-agent/pkg/config/structure github.com/DataDog/datadog-agent/pkg/config/utils github.com/DataDog/datadog-agent/pkg/diagnose/diagnosis github.com/DataDog/datadog-agent/pkg/errors diff --git a/cmd/serverless/dependencies_linux_arm64.txt b/cmd/serverless/dependencies_linux_arm64.txt index c2a3aaf557d01..da674cfca6e69 100644 --- a/cmd/serverless/dependencies_linux_arm64.txt +++ b/cmd/serverless/dependencies_linux_arm64.txt @@ -144,6 +144,7 @@ github.com/DataDog/datadog-agent/pkg/config/model github.com/DataDog/datadog-agent/pkg/config/remote/data github.com/DataDog/datadog-agent/pkg/config/setup github.com/DataDog/datadog-agent/pkg/config/setup/constants +github.com/DataDog/datadog-agent/pkg/config/structure github.com/DataDog/datadog-agent/pkg/config/utils github.com/DataDog/datadog-agent/pkg/diagnose/diagnosis github.com/DataDog/datadog-agent/pkg/errors diff --git a/comp/autoscaling/datadogclient/impl/client.go b/comp/autoscaling/datadogclient/impl/client.go index 406b793b916ff..ee204f1f921f3 100644 --- a/comp/autoscaling/datadogclient/impl/client.go +++ b/comp/autoscaling/datadogclient/impl/client.go @@ -14,6 +14,7 @@ import ( configComponent "github.com/DataDog/datadog-agent/comp/core/config" logComp "github.com/DataDog/datadog-agent/comp/core/log/def" "github.com/DataDog/datadog-agent/comp/core/status" + "github.com/DataDog/datadog-agent/pkg/config/structure" "gopkg.in/zorkian/go-datadog-api.v2" ) @@ -120,7 +121,7 @@ func (d *datadogClientWrapper) refreshClient() { func createDatadogClient(cfg configComponent.Component, logger logComp.Component) (datadogclient.Component, error) { if cfg.IsSet(metricsRedundantEndpointConfig) { var endpoints []endpoint - if err := cfg.UnmarshalKey(metricsRedundantEndpointConfig, &endpoints); err != nil { + if err := structure.UnmarshalKey(cfg, metricsRedundantEndpointConfig, &endpoints); err != nil { return nil, fmt.Errorf("could not parse %s: %v", metricsRedundantEndpointConfig, err) } diff --git a/comp/dogstatsd/mapper/mapper_test.go b/comp/dogstatsd/mapper/mapper_test.go index ff05c83dcc281..c6139d4febf12 100644 --- a/comp/dogstatsd/mapper/mapper_test.go +++ b/comp/dogstatsd/mapper/mapper_test.go @@ -16,6 +16,7 @@ import ( "github.com/stretchr/testify/require" configComponent "github.com/DataDog/datadog-agent/comp/core/config" + "github.com/DataDog/datadog-agent/pkg/config/structure" ) func TestMappings(t *testing.T) { @@ -519,7 +520,7 @@ func getMapper(t *testing.T, configString string) (*MetricMapper, error) { cfg := configComponent.NewMockFromYAML(t, configString) - err := cfg.UnmarshalKey("dogstatsd_mapper_profiles", &profiles) + err := structure.UnmarshalKey(cfg, "dogstatsd_mapper_profiles", &profiles) if err != nil { return nil, err } diff --git a/comp/dogstatsd/server/server.go b/comp/dogstatsd/server/server.go index cb57d37f193f7..059fdafdff191 100644 --- a/comp/dogstatsd/server/server.go +++ b/comp/dogstatsd/server/server.go @@ -30,6 +30,7 @@ import ( serverdebug "github.com/DataDog/datadog-agent/comp/dogstatsd/serverDebug" "github.com/DataDog/datadog-agent/pkg/aggregator" "github.com/DataDog/datadog-agent/pkg/config/model" + "github.com/DataDog/datadog-agent/pkg/config/structure" "github.com/DataDog/datadog-agent/pkg/config/utils" "github.com/DataDog/datadog-agent/pkg/metrics" "github.com/DataDog/datadog-agent/pkg/metrics/event" @@ -835,7 +836,7 @@ func getBuckets(cfg model.Reader, logger log.Component, option string) []float64 func getDogstatsdMappingProfiles(cfg model.Reader) ([]mapper.MappingProfileConfig, error) { var mappings []mapper.MappingProfileConfig if cfg.IsSet("dogstatsd_mapper_profiles") { - err := cfg.UnmarshalKey("dogstatsd_mapper_profiles", &mappings) + err := structure.UnmarshalKey(cfg, "dogstatsd_mapper_profiles", &mappings) if err != nil { return []mapper.MappingProfileConfig{}, fmt.Errorf("Could not parse dogstatsd_mapper_profiles: %v", err) } diff --git a/comp/logs/agent/config/config.go b/comp/logs/agent/config/config.go index 5c188e2139168..4a383358329a1 100644 --- a/comp/logs/agent/config/config.go +++ b/comp/logs/agent/config/config.go @@ -15,6 +15,7 @@ import ( "time" pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model" + "github.com/DataDog/datadog-agent/pkg/config/structure" pkgconfigutils "github.com/DataDog/datadog-agent/pkg/config/utils" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -70,7 +71,7 @@ func GlobalProcessingRules(coreConfig pkgconfigmodel.Reader) ([]*ProcessingRule, if s, ok := raw.(string); ok && s != "" { err = json.Unmarshal([]byte(s), &rules) } else { - err = coreConfig.UnmarshalKey("logs_config.processing_rules", &rules) + err = structure.UnmarshalKey(coreConfig, "logs_config.processing_rules", &rules, structure.ConvertEmptyStringToNil) } if err != nil { return nil, err diff --git a/comp/logs/agent/config/config_keys.go b/comp/logs/agent/config/config_keys.go index df5ee1ad4abe6..0f9dbbf2b36de 100644 --- a/comp/logs/agent/config/config_keys.go +++ b/comp/logs/agent/config/config_keys.go @@ -11,6 +11,7 @@ import ( pkgconfigmodel "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" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -152,7 +153,7 @@ func (l *LogsConfigKeys) getAdditionalEndpoints() []unmarshalEndpoint { if s, ok := raw.(string); ok && s != "" { err = json.Unmarshal([]byte(s), &endpoints) } else { - err = l.getConfig().UnmarshalKey(configKey, &endpoints) + err = structure.UnmarshalKey(l.getConfig(), configKey, &endpoints, structure.EnableSquash) } if err != nil { log.Warnf("Could not parse additional_endpoints for logs: %v", err) diff --git a/comp/logs/agent/config/go.mod b/comp/logs/agent/config/go.mod index ee7c4157195db..2471fd0f3416f 100644 --- a/comp/logs/agent/config/go.mod +++ b/comp/logs/agent/config/go.mod @@ -16,6 +16,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../../../pkg/config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../../../pkg/config/model/ 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/utils => ../../../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/telemetry => ../../../../pkg/telemetry github.com/DataDog/datadog-agent/pkg/util/executable => ../../../../pkg/util/executable @@ -35,12 +36,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.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/setup 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/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.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.0 + github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 github.com/DataDog/viper v1.13.5 github.com/stretchr/testify v1.9.0 go.uber.org/fx v1.22.2 @@ -49,19 +51,19 @@ 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.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.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/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/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/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/pkg/util/executable v0.57.0 // 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.0 // 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.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/netflow/config/config.go b/comp/netflow/config/config.go index ed5db3eb41bbc..1854ed39dfc1a 100644 --- a/comp/netflow/config/config.go +++ b/comp/netflow/config/config.go @@ -12,6 +12,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" + "github.com/DataDog/datadog-agent/pkg/config/structure" "github.com/DataDog/datadog-agent/pkg/snmp/utils" "github.com/DataDog/datadog-agent/comp/netflow/common" @@ -59,7 +60,7 @@ type Mapping struct { func ReadConfig(conf config.Component, logger log.Component) (*NetflowConfig, error) { var mainConfig NetflowConfig - err := conf.UnmarshalKey("network_devices.netflow", &mainConfig) + err := structure.UnmarshalKey(conf, "network_devices.netflow", &mainConfig) if err != nil { return nil, err } diff --git a/comp/otelcol/ddflareextension/impl/go.mod b/comp/otelcol/ddflareextension/impl/go.mod index bd241abb5beb1..dc737f335465f 100644 --- a/comp/otelcol/ddflareextension/impl/go.mod +++ b/comp/otelcol/ddflareextension/impl/go.mod @@ -43,6 +43,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../../../pkg/config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../../../pkg/config/model 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/utils => ../../../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/logs/auditor => ../../../../pkg/logs/auditor github.com/DataDog/datadog-agent/pkg/logs/client => ../../../../pkg/logs/client @@ -155,7 +156,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.0-rc.3 // 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.56.2 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 // indirect github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/tagger/types v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.56.2 // indirect @@ -175,11 +176,12 @@ require ( 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/aggregator/ckey v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.2 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.56.2 // 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/model v0.56.2 // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 // 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/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 @@ -209,23 +211,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.56.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.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.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.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.56.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/optional v0.56.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/log 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.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.56.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.2 // 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/tagger v0.56.2 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.26.0 // indirect github.com/DataDog/datadog-go/v5 v5.5.0 // indirect diff --git a/comp/otelcol/logsagentpipeline/go.mod b/comp/otelcol/logsagentpipeline/go.mod index b5adb734302e7..03f9f36a6d637 100644 --- a/comp/otelcol/logsagentpipeline/go.mod +++ b/comp/otelcol/logsagentpipeline/go.mod @@ -20,6 +20,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../../pkg/config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../../pkg/config/model 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/utils => ../../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/logs/auditor => ../../../pkg/logs/auditor github.com/DataDog/datadog-agent/pkg/logs/client => ../../../pkg/logs/client @@ -61,14 +62,15 @@ 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.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.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.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/setup 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/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/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 @@ -84,20 +86,20 @@ 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.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/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.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/hostname/validate v0.57.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.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/log 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.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.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/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.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 471ae801b59bb..1740ca3ca7ede 100644 --- a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod +++ b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod @@ -21,6 +21,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../../../pkg/config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../../../pkg/config/model 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/utils => ../../../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/logs/auditor => ../../../../pkg/logs/auditor github.com/DataDog/datadog-agent/pkg/logs/client => ../../../../pkg/logs/client @@ -64,8 +65,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.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/setup 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/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 @@ -76,7 +77,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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/optional v0.57.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 @@ -88,12 +89,13 @@ 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.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.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.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/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/structure v0.0.0-00010101000000-000000000000 // 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 github.com/DataDog/datadog-agent/pkg/logs/sds v0.56.0-rc.3 // indirect @@ -101,18 +103,18 @@ 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.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/executable v0.57.0 // 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/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.57.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.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/pointer v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.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.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/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.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 49df310b52c0a..acbef53a372a3 100644 --- a/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod @@ -34,6 +34,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../../../../../pkg/config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../../../../../pkg/config/model 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/utils => ../../../../../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/logs/auditor => ../../../../../../pkg/logs/auditor github.com/DataDog/datadog-agent/pkg/logs/client => ../../../../../../pkg/logs/client @@ -97,7 +98,7 @@ require ( github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/serializer v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.20.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.20.0 @@ -127,7 +128,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.0-rc.3 // 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.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.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.56.0-rc.3 // indirect @@ -137,11 +138,12 @@ require ( github.com/DataDog/datadog-agent/comp/serializer/compression 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/pkg/aggregator/ckey 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/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/model 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/model v0.57.0 // 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/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 @@ -167,21 +169,21 @@ 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.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/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // 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.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/log 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.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.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/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.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // 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 33d8b3e3dd81b..726a091dff399 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod @@ -17,6 +17,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../../../../../pkg/config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../../../../../pkg/config/model 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/utils => ../../../../../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/logs/message => ../../../../../../pkg/logs/message github.com/DataDog/datadog-agent/pkg/logs/sources => ../../../../../../pkg/logs/sources @@ -44,7 +45,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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.20.0 github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.20.0 github.com/stormcat24/protodep v0.1.8 @@ -55,24 +56,25 @@ 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/setup v0.56.0-rc.3 // indirect + 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/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/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.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/log 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/executable v0.57.0 // 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.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/statstracker 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/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.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.20.0 // indirect diff --git a/comp/snmptraps/config/config.go b/comp/snmptraps/config/config.go index 97afe10653c77..418f38a107dd0 100644 --- a/comp/snmptraps/config/config.go +++ b/comp/snmptraps/config/config.go @@ -14,6 +14,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" "github.com/DataDog/datadog-agent/comp/snmptraps/snmplog" + "github.com/DataDog/datadog-agent/pkg/config/structure" "github.com/DataDog/datadog-agent/pkg/snmp/gosnmplib" "github.com/DataDog/datadog-agent/pkg/snmp/utils" ) @@ -51,7 +52,7 @@ type TrapsConfig struct { // ReadConfig builds the traps configuration from the Agent configuration. func ReadConfig(host string, conf config.Component) (*TrapsConfig, error) { var c = &TrapsConfig{} - err := conf.UnmarshalKey("network_devices.snmp_traps", &c) + err := structure.UnmarshalKey(conf, "network_devices.snmp_traps", c) if err != nil { return nil, err } diff --git a/comp/trace/config/setup.go b/comp/trace/config/setup.go index c1aa31c3c40b7..df0e554d76262 100644 --- a/comp/trace/config/setup.go +++ b/comp/trace/config/setup.go @@ -28,6 +28,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/config/env" "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" "github.com/DataDog/datadog-agent/pkg/config/utils" "github.com/DataDog/datadog-agent/pkg/trace/config" "github.com/DataDog/datadog-agent/pkg/trace/traceutil" @@ -312,7 +313,7 @@ func applyDatadogConfig(c *config.AgentConfig, core corecompcfg.Component) error if k := "apm_config.replace_tags"; core.IsSet(k) { rt := make([]*config.ReplaceRule, 0) - if err := pkgconfigsetup.Datadog().UnmarshalKey(k, &rt); err != nil { + if err := structure.UnmarshalKey(core, k, &rt); err != nil { log.Errorf("Bad format for %q it should be of the form '[{\"name\": \"tag_name\",\"pattern\":\"pattern\",\"repl\":\"replace_str\"}]', error: %v", "apm_config.replace_tags", err) } else { err := compileReplaceRules(rt) diff --git a/go.mod b/go.mod index 1900b025fc740..5b6afb5a4f1f9 100644 --- a/go.mod +++ b/go.mod @@ -73,6 +73,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/model => ./pkg/config/model/ github.com/DataDog/datadog-agent/pkg/config/remote => ./pkg/config/remote/ 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/utils => ./pkg/config/utils/ github.com/DataDog/datadog-agent/pkg/errors => ./pkg/errors github.com/DataDog/datadog-agent/pkg/gohai => ./pkg/gohai @@ -148,9 +149,9 @@ require ( github.com/DataDog/datadog-agent/pkg/security/secl v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/cgroups v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.56.2 - github.com/DataDog/datadog-agent/pkg/util/pointer v0.56.2 - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.0 + github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.0 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.57.0 github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/datadog-operator v1.8.0-rc.1 github.com/DataDog/ebpf-manager v0.7.1 @@ -598,6 +599,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.56.2 github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/impl v0.0.0-00010101000000-000000000000 + github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 github.com/containerd/containerd/api v1.7.19 github.com/containerd/errdefs v0.1.0 github.com/distribution/reference v0.6.0 @@ -619,7 +621,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/log/impl v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/comp/core/log/impl-trace v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/comp/core/log/mock v0.0.0-00010101000000-000000000000 - github.com/DataDog/datadog-agent/comp/core/secrets v0.56.2 + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.0 github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/core/status/statusimpl v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/core/tagger/types v0.56.2 @@ -648,12 +650,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.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/api v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.56.2 - github.com/DataDog/datadog-agent/pkg/config/env v0.56.2 + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.0 + github.com/DataDog/datadog-agent/pkg/config/env v0.57.0 github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel - github.com/DataDog/datadog-agent/pkg/config/model v0.56.2 + github.com/DataDog/datadog-agent/pkg/config/model v0.57.0 github.com/DataDog/datadog-agent/pkg/config/remote v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/setup v0.56.2 + github.com/DataDog/datadog-agent/pkg/config/setup v0.57.0 github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/errors v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/auditor v0.56.0-rc.3 @@ -683,23 +685,23 @@ require ( github.com/DataDog/datadog-agent/pkg/util/cache 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/containers/image v0.56.2 - github.com/DataDog/datadog-agent/pkg/util/executable v0.56.2 - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/executable v0.57.0 + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.0 github.com/DataDog/datadog-agent/pkg/util/flavor 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/grpc v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.0 github.com/DataDog/datadog-agent/pkg/util/http 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/setup v1.0.0 - github.com/DataDog/datadog-agent/pkg/util/optional v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/optional v0.57.0 github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/system v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/system v0.57.0 github.com/DataDog/datadog-agent/pkg/util/tagger v0.56.2 // indirect github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/uuid v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.2 + github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.0 github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 github.com/DataDog/go-libddwaf/v3 v3.3.0 github.com/DataDog/go-sqllexer v0.0.14 @@ -769,7 +771,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/status/statusinterface 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/statstracker v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.2 // indirect + github.com/DataDog/datadog-agent/pkg/util/system/socket v0.57.0 // 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 github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.20.0 // indirect diff --git a/omnibus/config/projects/agent-binaries.rb b/omnibus/config/projects/agent-binaries.rb index d401fffcf1364..bd9e9c790a975 100644 --- a/omnibus/config/projects/agent-binaries.rb +++ b/omnibus/config/projects/agent-binaries.rb @@ -20,7 +20,7 @@ install_dir "C:/opt/datadog-agent/" maintainer 'Datadog Inc.' # Windows doesn't want our e-mail address :( else - install_dir '/opt/datadog-agent' + install_dir ENV["INSTALL_DIR"] || '/opt/datadog-agent' maintainer 'Datadog Packages ' end diff --git a/omnibus/config/projects/agent.rb b/omnibus/config/projects/agent.rb index 57cc9c6de3a39..16280c77f767b 100644 --- a/omnibus/config/projects/agent.rb +++ b/omnibus/config/projects/agent.rb @@ -5,6 +5,7 @@ require "./lib/ostools.rb" require "./lib/fips_compliance.rb" flavor = ENV['AGENT_FLAVOR'] +output_config_dir = ENV["OUTPUT_CONFIG_DIR"] if flavor.nil? || flavor == 'base' name 'agent' @@ -283,7 +284,7 @@ end if linux_target? - extra_package_file '/etc/datadog-agent/' + extra_package_file "#{output_config_dir}/etc/datadog-agent/" extra_package_file '/usr/bin/dd-agent' extra_package_file '/var/log/datadog/' end diff --git a/omnibus/config/projects/dogstatsd.rb b/omnibus/config/projects/dogstatsd.rb index 76800d8018b3b..43b5adadd94ad 100644 --- a/omnibus/config/projects/dogstatsd.rb +++ b/omnibus/config/projects/dogstatsd.rb @@ -29,7 +29,7 @@ install_dir "C:/opt/datadog-dogstatsd/" maintainer 'Datadog Inc.' # Windows doesn't want our e-mail address :( else - install_dir '/opt/datadog-dogstatsd' + install_dir ENV["INSTALL_DIR"] || '/opt/datadog-dogstatsd' if redhat_target? || suse_target? maintainer 'Datadog, Inc ' diff --git a/omnibus/config/projects/iot-agent.rb b/omnibus/config/projects/iot-agent.rb index f2e35368aab95..b14eace6f0540 100644 --- a/omnibus/config/projects/iot-agent.rb +++ b/omnibus/config/projects/iot-agent.rb @@ -20,7 +20,7 @@ install_dir "C:/opt/datadog-agent/" maintainer 'Datadog Inc.' # Windows doesn't want our e-mail address :( else - install_dir '/opt/datadog-agent' + install_dir ENV["INSTALL_DIR"] || '/opt/datadog-agent' if redhat_target? || suse_target? maintainer 'Datadog, Inc ' diff --git a/omnibus/config/software/datadog-agent-finalize.rb b/omnibus/config/software/datadog-agent-finalize.rb index 2d545f58b498b..f69104e560a0d 100644 --- a/omnibus/config/software/datadog-agent-finalize.rb +++ b/omnibus/config/software/datadog-agent-finalize.rb @@ -14,11 +14,13 @@ skip_transitive_dependency_licensing true + always_build true build do license :project_license + output_config_dir = ENV["OUTPUT_CONFIG_DIR"] flavor_arg = ENV['AGENT_FLAVOR'] # TODO too many things done here, should be split block do @@ -95,37 +97,37 @@ if linux_target? # Move configuration files - mkdir "/etc/datadog-agent" + mkdir "#{output_config_dir}/etc/datadog-agent" move "#{install_dir}/bin/agent/dd-agent", "/usr/bin/dd-agent" - move "#{install_dir}/etc/datadog-agent/datadog.yaml.example", "/etc/datadog-agent" - move "#{install_dir}/etc/datadog-agent/conf.d", "/etc/datadog-agent", :force=>true + move "#{install_dir}/etc/datadog-agent/datadog.yaml.example", "#{output_config_dir}/etc/datadog-agent" + move "#{install_dir}/etc/datadog-agent/conf.d", "#{output_config_dir}/etc/datadog-agent", :force=>true unless heroku_target? - move "#{install_dir}/etc/datadog-agent/system-probe.yaml.example", "/etc/datadog-agent" - move "#{install_dir}/etc/datadog-agent/security-agent.yaml.example", "/etc/datadog-agent", :force=>true - move "#{install_dir}/etc/datadog-agent/runtime-security.d", "/etc/datadog-agent", :force=>true - move "#{install_dir}/etc/datadog-agent/compliance.d", "/etc/datadog-agent" + move "#{install_dir}/etc/datadog-agent/system-probe.yaml.example", "#{output_config_dir}/etc/datadog-agent" + move "#{install_dir}/etc/datadog-agent/security-agent.yaml.example", "#{output_config_dir}/etc/datadog-agent", :force=>true + move "#{install_dir}/etc/datadog-agent/runtime-security.d", "#{output_config_dir}/etc/datadog-agent", :force=>true + move "#{install_dir}/etc/datadog-agent/compliance.d", "#{output_config_dir}/etc/datadog-agent" # Move SELinux policy if debian_target? || redhat_target? - move "#{install_dir}/etc/datadog-agent/selinux", "/etc/datadog-agent/selinux" + move "#{install_dir}/etc/datadog-agent/selinux", "#{output_config_dir}/etc/datadog-agent/selinux" end end if ot_target? - move "#{install_dir}/etc/datadog-agent/otel-config.yaml.example", "/etc/datadog-agent" + move "#{install_dir}/etc/datadog-agent/otel-config.yaml.example", "#{output_config_dir}/etc/datadog-agent" end # Create empty directories so that they're owned by the package # (also requires `extra_package_file` directive in project def) - mkdir "/etc/datadog-agent/checks.d" + mkdir "#{output_config_dir}/etc/datadog-agent/checks.d" mkdir "/var/log/datadog" # remove unused configs - delete "/etc/datadog-agent/conf.d/apm.yaml.default" - delete "/etc/datadog-agent/conf.d/process_agent.yaml.default" + delete "#{output_config_dir}/etc/datadog-agent/conf.d/apm.yaml.default" + delete "#{output_config_dir}/etc/datadog-agent/conf.d/process_agent.yaml.default" # remove windows specific configs - delete "/etc/datadog-agent/conf.d/winproc.d" + delete "#{output_config_dir}/etc/datadog-agent/conf.d/winproc.d" # cleanup clutter delete "#{install_dir}/etc" @@ -177,6 +179,9 @@ # Most postgres binaries are removed in postgres' own software # recipe, but we need pg_config to build psycopq. delete "#{install_dir}/embedded/bin/pg_config" + + # Edit rpath from a true path to relative path for each binary + command "inv omnibus.rpath-edit #{install_dir} #{install_dir}", cwd: Dir.pwd end if osx_target? @@ -189,6 +194,9 @@ # remove docker configuration delete "#{install_dir}/etc/conf.d/docker.d" + # Edit rpath from a true path to relative path for each binary + command "inv omnibus.rpath-edit #{install_dir} #{install_dir} --platform=macos", cwd: Dir.pwd + if ENV['HARDENED_RUNTIME_MAC'] == 'true' hardened_runtime = "-o runtime --entitlements #{entitlements_file} " else diff --git a/omnibus/config/software/datadog-agent.rb b/omnibus/config/software/datadog-agent.rb index 6d2e572bab2f3..6f7ab7f617b90 100644 --- a/omnibus/config/software/datadog-agent.rb +++ b/omnibus/config/software/datadog-agent.rb @@ -236,6 +236,7 @@ # The file below is touched by software builds that don't put anything in the installation # directory (libgcc right now) so that the git_cache gets updated let's remove it from the # final package + # Change RPATH from the install_dir to relative RPATH unless windows_target? delete "#{install_dir}/uselessfile" end diff --git a/omnibus/config/software/init-scripts-agent.rb b/omnibus/config/software/init-scripts-agent.rb index b425b8bd4f334..7add284c1ba38 100644 --- a/omnibus/config/software/init-scripts-agent.rb +++ b/omnibus/config/software/init-scripts-agent.rb @@ -5,8 +5,9 @@ always_build true build do + output_config_dir = ENV["OUTPUT_CONFIG_DIR"] || "" if linux_target? - etc_dir = "/etc/datadog-agent" + etc_dir = "#{output_config_dir}/etc/datadog-agent" mkdir "/etc/init" if debian_target? # sysvinit support for debian only for now diff --git a/pkg/clusteragent/autoscaling/workload/controller.go b/pkg/clusteragent/autoscaling/workload/controller.go index ce46091da3ba6..d6d8b9dd22b41 100644 --- a/pkg/clusteragent/autoscaling/workload/controller.go +++ b/pkg/clusteragent/autoscaling/workload/controller.go @@ -14,6 +14,7 @@ import ( "k8s.io/apimachinery/pkg/api/errors" apimeta "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" "k8s.io/client-go/dynamic/dynamicinformer" scaleclient "k8s.io/client-go/scale" @@ -282,12 +283,31 @@ func (c *Controller) syncPodAutoscaler(ctx context.Context, key, ns, name string return autoscaling.NoRequeue, c.updateAutoscalerStatusAndUnlock(ctx, key, ns, name, validationErr, podAutoscalerInternal, podAutoscaler) } + // Get autoscaler target + targetGVK, targetErr := podAutoscalerInternal.TargetGVK() + if targetErr != nil { + podAutoscalerInternal.SetError(targetErr) + return autoscaling.NoRequeue, c.updateAutoscalerStatusAndUnlock(ctx, key, ns, name, targetErr, podAutoscalerInternal, podAutoscaler) + } + target := NamespacedPodOwner{ + Namespace: podAutoscalerInternal.Namespace(), + Name: podAutoscalerInternal.Spec().TargetRef.Name, + Kind: targetGVK.Kind, + } + // Now that everything is synced, we can perform the actual processing - result, scalingErr := c.handleScaling(ctx, podAutoscaler, &podAutoscalerInternal) + result, scalingErr := c.handleScaling(ctx, podAutoscaler, &podAutoscalerInternal, targetGVK, target) + + // Update current replicas + pods := c.podWatcher.GetPodsForOwner(target) + currentReplicas := len(pods) + podAutoscalerInternal.SetCurrentReplicas(int32(currentReplicas)) + + // Update status based on latest state return result, c.updateAutoscalerStatusAndUnlock(ctx, key, ns, name, scalingErr, podAutoscalerInternal, podAutoscaler) } -func (c *Controller) handleScaling(ctx context.Context, podAutoscaler *datadoghq.DatadogPodAutoscaler, podAutoscalerInternal *model.PodAutoscalerInternal) (autoscaling.ProcessResult, error) { +func (c *Controller) handleScaling(ctx context.Context, podAutoscaler *datadoghq.DatadogPodAutoscaler, podAutoscalerInternal *model.PodAutoscalerInternal, targetGVK schema.GroupVersionKind, target NamespacedPodOwner) (autoscaling.ProcessResult, error) { // TODO: While horizontal scaling is in progress we should not start vertical scaling // While vertical scaling is in progress we should only allow horizontal upscale horizontalRes, err := c.horizontalController.sync(ctx, podAutoscaler, podAutoscalerInternal) @@ -295,7 +315,7 @@ func (c *Controller) handleScaling(ctx context.Context, podAutoscaler *datadoghq return horizontalRes, err } - verticalRes, err := c.verticalController.sync(ctx, podAutoscaler, podAutoscalerInternal) + verticalRes, err := c.verticalController.sync(ctx, podAutoscaler, podAutoscalerInternal, targetGVK, target) if err != nil { return verticalRes, err } diff --git a/pkg/clusteragent/autoscaling/workload/controller_horizontal.go b/pkg/clusteragent/autoscaling/workload/controller_horizontal.go index 9c3c043d02c21..3a9c0ac675033 100644 --- a/pkg/clusteragent/autoscaling/workload/controller_horizontal.go +++ b/pkg/clusteragent/autoscaling/workload/controller_horizontal.go @@ -79,9 +79,6 @@ func (hr *horizontalController) sync(ctx context.Context, podAutoscaler *datadog return autoscaling.Requeue, err } - // Update current replicas - autoscalerInternal.SetCurrentReplicas(scale.Status.Replicas) - return hr.performScaling(ctx, podAutoscaler, autoscalerInternal, gr, scale) } diff --git a/pkg/clusteragent/autoscaling/workload/controller_horizontal_test.go b/pkg/clusteragent/autoscaling/workload/controller_horizontal_test.go index 009811fbf4a39..f306f680bbc34 100644 --- a/pkg/clusteragent/autoscaling/workload/controller_horizontal_test.go +++ b/pkg/clusteragent/autoscaling/workload/controller_horizontal_test.go @@ -111,7 +111,6 @@ func (f *horizontalControllerFixture) testScalingDecision(args horizontalScaling f.scaler.AssertNumberOfCalls(f.t, "get", 1) f.scaler.AssertNumberOfCalls(f.t, "update", expectedUpdateCalls) - args.fakePai.CurrentReplicas = pointer.Ptr[int32](args.statusReplicas) if scaleActionExpected && args.scaleError == nil { // Update fakePai with the new expected state action := &datadoghq.DatadogPodAutoscalerHorizontalAction{ @@ -142,8 +141,9 @@ func TestHorizontalControllerSyncPrerequisites(t *testing.T) { autoscalerName := "test" fakePai := &model.FakePodAutoscalerInternal{ - Namespace: autoscalerNamespace, - Name: autoscalerName, + Namespace: autoscalerNamespace, + Name: autoscalerName, + CurrentReplicas: pointer.Ptr[int32](5), } // Test case: no Spec, no action taken @@ -165,7 +165,7 @@ func TestHorizontalControllerSyncPrerequisites(t *testing.T) { model.AssertPodAutoscalersEqual(t, fakePai.Build(), autoscaler) // Test case: Correct Spec and GVK, but no scaling values - // Should only update replica count + // Should do nothing expectedGVK := schema.GroupVersionKind{ Group: "apps", Version: "v1", @@ -304,7 +304,8 @@ func TestHorizontalControllerSyncScaleDecisions(t *testing.T) { Replicas: 5, }, }, - TargetGVK: expectedGVK, + TargetGVK: expectedGVK, + CurrentReplicas: pointer.Ptr[int32](5), } // Step: same number of replicas, no action taken, only updating status diff --git a/pkg/clusteragent/autoscaling/workload/controller_vertical.go b/pkg/clusteragent/autoscaling/workload/controller_vertical.go index 5ea9d8d4f300a..2a940490d875a 100644 --- a/pkg/clusteragent/autoscaling/workload/controller_vertical.go +++ b/pkg/clusteragent/autoscaling/workload/controller_vertical.go @@ -56,7 +56,7 @@ func newVerticalController(clock clock.Clock, eventRecorder record.EventRecorder return res } -func (u *verticalController) sync(ctx context.Context, podAutoscaler *datadoghq.DatadogPodAutoscaler, autoscalerInternal *model.PodAutoscalerInternal) (autoscaling.ProcessResult, error) { +func (u *verticalController) sync(ctx context.Context, podAutoscaler *datadoghq.DatadogPodAutoscaler, autoscalerInternal *model.PodAutoscalerInternal, targetGVK schema.GroupVersionKind, target NamespacedPodOwner) (autoscaling.ProcessResult, error) { scalingValues := autoscalerInternal.ScalingValues() // Check if the autoscaler has a vertical scaling recommendation @@ -67,18 +67,6 @@ func (u *verticalController) sync(ctx context.Context, podAutoscaler *datadoghq. } recomendationID := scalingValues.Vertical.ResourcesHash - targetGVK, err := autoscalerInternal.TargetGVK() - if err != nil { - autoscalerInternal.SetError(err) - return autoscaling.NoRequeue, err - } - - // Get the pod owner from the workload - target := NamespacedPodOwner{ - Namespace: autoscalerInternal.Namespace(), - Name: autoscalerInternal.Spec().TargetRef.Name, - Kind: targetGVK.Kind, - } // Get the pods for the pod owner pods := u.podWatcher.GetPodsForOwner(target) diff --git a/pkg/config/model/go.mod b/pkg/config/model/go.mod index 6d714751b915c..beb9f68bd7c75 100644 --- a/pkg/config/model/go.mod +++ b/pkg/config/model/go.mod @@ -3,6 +3,7 @@ module github.com/DataDog/datadog-agent/pkg/config/model go 1.22.0 replace ( + github.com/DataDog/datadog-agent/pkg/config/structure => ../../../pkg/config/structure/ github.com/DataDog/datadog-agent/pkg/util/log => ../../util/log/ github.com/DataDog/datadog-agent/pkg/util/scrubber => ../../util/scrubber/ github.com/DataDog/datadog-agent/pkg/util/system/socket => ../../util/system/socket/ diff --git a/pkg/config/structure/go.mod b/pkg/config/structure/go.mod new file mode 100644 index 0000000000000..9dede435250a1 --- /dev/null +++ b/pkg/config/structure/go.mod @@ -0,0 +1,86 @@ +module github.com/DataDog/datadog-agent/pkg/config/structure + +go 1.22.0 + +replace ( + github.com/DataDog/datadog-agent/comp/api/api/def => ../../../comp/api/api/def + github.com/DataDog/datadog-agent/comp/core/flare/builder => ../../../comp/core/flare/builder + github.com/DataDog/datadog-agent/comp/core/flare/types => ../../../comp/core/flare/types + github.com/DataDog/datadog-agent/comp/core/secrets => ../../../comp/core/secrets + github.com/DataDog/datadog-agent/comp/core/telemetry => ../../../comp/core/telemetry + github.com/DataDog/datadog-agent/comp/def => ../../../comp/def + github.com/DataDog/datadog-agent/pkg/collector/check/defaults => ../../../pkg/collector/check/defaults + github.com/DataDog/datadog-agent/pkg/config/env => ../../../pkg/config/env + github.com/DataDog/datadog-agent/pkg/config/mock => ../../../pkg/config/mock + github.com/DataDog/datadog-agent/pkg/config/model => ../../../pkg/config/model + github.com/DataDog/datadog-agent/pkg/config/setup => ../../../pkg/config/setup + github.com/DataDog/datadog-agent/pkg/util/executable => ../../../pkg/util/executable + github.com/DataDog/datadog-agent/pkg/util/filesystem => ../../../pkg/util/filesystem + github.com/DataDog/datadog-agent/pkg/util/fxutil => ../../../pkg/util/fxutil + github.com/DataDog/datadog-agent/pkg/util/hostname/validate => ../../../pkg/util/hostname/validate + github.com/DataDog/datadog-agent/pkg/util/log => ../../../pkg/util/log + github.com/DataDog/datadog-agent/pkg/util/optional => ../../../pkg/util/optional + github.com/DataDog/datadog-agent/pkg/util/pointer => ../../../pkg/util/pointer + github.com/DataDog/datadog-agent/pkg/util/scrubber => ../../../pkg/util/scrubber + github.com/DataDog/datadog-agent/pkg/util/system => ../../../pkg/util/system + github.com/DataDog/datadog-agent/pkg/util/system/socket => ../../../pkg/util/system/socket + github.com/DataDog/datadog-agent/pkg/util/testutil => ../../../pkg/util/testutil + github.com/DataDog/datadog-agent/pkg/util/winutil => ../../../pkg/util/winutil +) + +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/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/setup 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/log 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/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 + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/shirou/gopsutil/v3 v3.23.12 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/spf13/afero v1.1.2 // indirect + github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + go.uber.org/atomic v1.11.0 // indirect + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/tools v0.24.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/pkg/config/structure/go.sum b/pkg/config/structure/go.sum new file mode 100644 index 0000000000000..77ba213060c82 --- /dev/null +++ b/pkg/config/structure/go.sum @@ -0,0 +1,352 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DataDog/viper v1.13.5 h1:SZMcyMknYQN2jRY/40A16gUXexlNJOI8sDs1cWZnI64= +github.com/DataDog/viper v1.13.5/go.mod h1:wDdUVJ2SHaMaPrCZrlRCObwkubsX8j5sme3LaR/SGTc= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= +github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9GbyCZHuPgZsrbyIbyKhSzOpg6s= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= +github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= +github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= +github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= +github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= +github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= +github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= +go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/dig v1.18.0 h1:imUL1UiY0Mg4bqbFfsRQO5G4CGRBec/ZujWTvSVp3pw= +go.uber.org/dig v1.18.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= +go.uber.org/fx v1.22.2 h1:iPW+OPxv0G8w75OemJ1RAnTUrF55zOJlXlo1TbJ0Buw= +go.uber.org/fx v1.22.2/go.mod h1:o/D9n+2mLP6v1EG+qsdT1O8wKopYAsqZasju97SDFCU= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190529164535-6a60838ec259/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/pkg/config/structure/unmarshal.go b/pkg/config/structure/unmarshal.go index 9fae31b6399b9..be426cb88fe81 100644 --- a/pkg/config/structure/unmarshal.go +++ b/pkg/config/structure/unmarshal.go @@ -17,12 +17,44 @@ import ( "github.com/DataDog/datadog-agent/pkg/config/model" ) +// features allowed for handling edge-cases +type featureSet struct { + allowSquash bool + convertEmptyStrNil bool +} + +// UnmarshalKeyOption is an option that affects the enabled features in UnmarshalKey +type UnmarshalKeyOption func(*featureSet) + +// EnableSquash allows UnmarshalKey to take advantage of `mapstructure`s `squash` feature +// a squashed field hoists its fields up a level in the marshalled representation and directly embeds them +var EnableSquash UnmarshalKeyOption = func(fs *featureSet) { + fs.allowSquash = true +} + +// ConvertEmptyStringToNil allows UnmarshalKey to implicitly convert empty strings into nil slices +var ConvertEmptyStringToNil UnmarshalKeyOption = func(fs *featureSet) { + fs.convertEmptyStrNil = true +} + +// error for when a key is not found +var errNotFound = fmt.Errorf("not found") + // UnmarshalKey retrieves data from the config at the given key and deserializes it // to be stored on the target struct. It is implemented entirely using reflection, and // does not depend upon details of the data model of the config. // Target struct can use of struct tag of "yaml", "json", or "mapstructure" to rename fields -func UnmarshalKey(cfg model.Reader, key string, target interface{}) error { - source, err := newNode(reflect.ValueOf(cfg.Get(key))) +func UnmarshalKey(cfg model.Reader, key string, target interface{}, opts ...UnmarshalKeyOption) error { + fs := &featureSet{} + for _, o := range opts { + o(fs) + } + rawval := cfg.Get(key) + // Don't create a reflect.Value out of nil, just return immediately + if rawval == nil { + return nil + } + source, err := newNode(reflect.ValueOf(rawval)) if err != nil { return err } @@ -32,21 +64,25 @@ func UnmarshalKey(cfg model.Reader, key string, target interface{}) error { } switch outValue.Kind() { case reflect.Map: - return copyMap(outValue, source) + return copyMap(outValue, source, fs) case reflect.Struct: - return copyStruct(outValue, source) + return copyStruct(outValue, source, fs) case reflect.Slice: if arr, ok := source.(arrayNode); ok { - return copyList(outValue, arr) + return copyList(outValue, arr, fs) } - return fmt.Errorf("can not UnmarshalKey to a slice from a non-list source") + if isEmptyString(source) { + if fs.convertEmptyStrNil { + return nil + } + return fmt.Errorf("treating empty string as a nil slice not allowed for UnmarshalKey without ConvertEmptyStrNil option") + } + return fmt.Errorf("can not UnmarshalKey to a slice from a non-list source: %T", source) default: return fmt.Errorf("can only UnmarshalKey to struct, map, or slice, got %v", outValue.Kind()) } } -var errNotFound = fmt.Errorf("not found") - // leafNode represents a leaf with a scalar value type leafNode interface { @@ -94,6 +130,9 @@ type innerNodeImpl struct { type innerMapNodeImpl struct { // val must be a map[string]interface{} val reflect.Value + // remapCase maps each lower-case key to the original case. This + // enables GetChild to retrieve values using case-insensitive keys + remapCase map[string]string } var _ node = (*innerNodeImpl)(nil) @@ -104,7 +143,7 @@ func newNode(v reflect.Value) (node, error) { if v.Kind() == reflect.Struct { return &innerNodeImpl{val: v}, nil } else if v.Kind() == reflect.Map { - return &innerMapNodeImpl{val: v}, nil + return &innerMapNodeImpl{val: v, remapCase: makeRemapCase(v)}, nil } else if v.Kind() == reflect.Slice { return &arrayNodeImpl{val: v}, nil } else if isScalarKind(v) { @@ -113,7 +152,7 @@ func newNode(v reflect.Value) (node, error) { return nil, fmt.Errorf("could not create node from: %v of type %T and kind %v", v, v, v.Kind()) } -// GetChild returns the child node at the given key, or an error if not found +// GetChild returns the child node at the given case-insensitive key, or an error if not found func (n *innerNodeImpl) GetChild(key string) (node, error) { findex := findFieldMatch(n.val, key) if findex == -1 { @@ -136,14 +175,16 @@ func (n *innerNodeImpl) ChildrenKeys() ([]string, error) { if unicode.IsLower(ch) { continue } - keys = append(keys, fieldNameToKey(f)) + fieldKey, _ := fieldNameToKey(f) + keys = append(keys, fieldKey) } return keys, nil } -// GetChild returns the child node at the given key, or an error if not found +// GetChild returns the child node at the given case-insensitive key, or an error if not found func (n *innerMapNodeImpl) GetChild(key string) (node, error) { - inner := n.val.MapIndex(reflect.ValueOf(key)) + mkey := n.remapCase[strings.ToLower(key)] + inner := n.val.MapIndex(reflect.ValueOf(mkey)) if !inner.IsValid() { return nil, errNotFound } @@ -195,8 +236,8 @@ func (n *arrayNodeImpl) Index(k int) (node, error) { } // GetChild returns an error because a leaf has no children -func (n *leafNodeImpl) GetChild(string) (node, error) { - return nil, fmt.Errorf("can't GetChild of a leaf node") +func (n *leafNodeImpl) GetChild(key string) (node, error) { + return nil, fmt.Errorf("can't GetChild(%s) of a leaf node", key) } // ChildrenKeys returns an error because a leaf has no children @@ -259,23 +300,40 @@ func convertToBool(text string) (bool, error) { return false, newConversionError(reflect.ValueOf(text), "bool") } -func fieldNameToKey(field reflect.StructField) string { +type specifierSet map[string]struct{} + +// fieldNameToKey returns the lower-cased field name, for case insensitive comparisons, +// with struct tag rename applied, as well as the set of specifiers from struct tags +// struct tags are handled in order of yaml, then json, then mapstructure +func fieldNameToKey(field reflect.StructField) (string, specifierSet) { name := field.Name - if tagtext := field.Tag.Get("yaml"); tagtext != "" { - name = tagtext - } else if tagtext := field.Tag.Get("json"); tagtext != "" { - name = tagtext - } else if tagtext := field.Tag.Get("mapstructure"); tagtext != "" { - name = tagtext + + tagtext := "" + if val := field.Tag.Get("yaml"); val != "" { + tagtext = val + } else if val := field.Tag.Get("json"); val != "" { + tagtext = val + } else if val := field.Tag.Get("mapstructure"); val != "" { + tagtext = val } - // skip any additional specifiers such as ",omitempty" - if commaPos := strings.IndexRune(name, ','); commaPos != -1 { - name = name[:commaPos] + + // skip any additional specifiers such as ",omitempty" or ",squash" + // TODO: support multiple specifiers + var specifiers map[string]struct{} + if commaPos := strings.IndexRune(tagtext, ','); commaPos != -1 { + specifiers = make(map[string]struct{}) + val := tagtext[:commaPos] + specifiers[tagtext[commaPos+1:]] = struct{}{} + if val != "" { + name = val + } + } else if tagtext != "" { + name = tagtext } - return name + return strings.ToLower(name), specifiers } -func copyStruct(target reflect.Value, source node) error { +func copyStruct(target reflect.Value, source node, fs *featureSet) error { targetType := target.Type() for i := 0; i < targetType.NumField(); i++ { f := targetType.Field(i) @@ -283,13 +341,25 @@ func copyStruct(target reflect.Value, source node) error { if unicode.IsLower(ch) { continue } - child, err := source.GetChild(fieldNameToKey(f)) + fieldKey, specifiers := fieldNameToKey(f) + if _, ok := specifiers["squash"]; ok { + if !fs.allowSquash { + return fmt.Errorf("feature 'squash' not allowed for UnmarshalKey without EnableSquash option") + } + err := copyAny(target.FieldByName(f.Name), source, fs) + if err != nil { + return err + } + continue + } + child, err := source.GetChild(fieldKey) if err == errNotFound { continue - } else if err != nil { + } + if err != nil { return err } - err = copyAny(target.FieldByName(f.Name), child) + err = copyAny(target.FieldByName(f.Name), child, fs) if err != nil { return err } @@ -297,7 +367,7 @@ func copyStruct(target reflect.Value, source node) error { return nil } -func copyMap(target reflect.Value, source node) error { +func copyMap(target reflect.Value, source node, _ *featureSet) error { // TODO: Should handle maps with more complex types in a future PR ktype := reflect.TypeOf("") vtype := reflect.TypeOf("") @@ -328,7 +398,7 @@ func copyMap(target reflect.Value, source node) error { return nil } -func copyLeaf(target reflect.Value, source leafNode) error { +func copyLeaf(target reflect.Value, source leafNode, _ *featureSet) error { if source == nil { return fmt.Errorf("source value is not a scalar") } @@ -372,7 +442,7 @@ func copyLeaf(target reflect.Value, source leafNode) error { return fmt.Errorf("unsupported scalar type %v", target.Kind()) } -func copyList(target reflect.Value, source arrayNode) error { +func copyList(target reflect.Value, source arrayNode, fs *featureSet) error { if source == nil { return fmt.Errorf("source value is not a list") } @@ -387,7 +457,7 @@ func copyList(target reflect.Value, source arrayNode) error { } ptrOut := reflect.New(elemType) outTarget := ptrOut.Elem() - err = copyAny(outTarget, elemSource) + err = copyAny(outTarget, elemSource, fs) if err != nil { return err } @@ -397,7 +467,7 @@ func copyList(target reflect.Value, source arrayNode) error { return nil } -func copyAny(target reflect.Value, source node) error { +func copyAny(target reflect.Value, source node, fs *featureSet) error { if target.Kind() == reflect.Pointer { allocPtr := reflect.New(target.Type().Elem()) target.Set(allocPtr) @@ -405,16 +475,16 @@ func copyAny(target reflect.Value, source node) error { } if isScalarKind(target) { if leaf, ok := source.(leafNode); ok { - return copyLeaf(target, leaf) + return copyLeaf(target, leaf, fs) } return fmt.Errorf("can't copy into target: scalar required, but source is not a leaf") } else if target.Kind() == reflect.Map { - return copyMap(target, source) + return copyMap(target, source, fs) } else if target.Kind() == reflect.Struct { - return copyStruct(target, source) + return copyStruct(target, source, fs) } else if target.Kind() == reflect.Slice { if arr, ok := source.(arrayNode); ok { - return copyList(target, arr) + return copyList(target, arr, fs) } return fmt.Errorf("can't copy into target: []T required, but source is not an array") } else if target.Kind() == reflect.Invalid { @@ -423,15 +493,43 @@ func copyAny(target reflect.Value, source node) error { return fmt.Errorf("unknown value to copy: %v", target.Type()) } +func isEmptyString(source node) bool { + if leaf, ok := source.(leafNode); ok { + if str, err := leaf.GetString(); err == nil { + return str == "" + } + } + return false +} + func isScalarKind(v reflect.Value) bool { k := v.Kind() return (k >= reflect.Bool && k <= reflect.Float64) || k == reflect.String } +func makeRemapCase(v reflect.Value) map[string]string { + remap := make(map[string]string) + iter := v.MapRange() + for iter.Next() { + mkey := "" + switch k := iter.Key().Interface().(type) { + case string: + mkey = k + default: + mkey = fmt.Sprintf("%s", k) + } + remap[strings.ToLower(mkey)] = mkey + } + return remap +} + func findFieldMatch(val reflect.Value, key string) int { + // case-insensitive match for struct names + key = strings.ToLower(key) schema := val.Type() for i := 0; i < schema.NumField(); i++ { - if key == fieldNameToKey(schema.Field(i)) { + fieldKey, _ := fieldNameToKey(schema.Field(i)) + if key == fieldKey { return i } } diff --git a/pkg/config/structure/unmarshal_test.go b/pkg/config/structure/unmarshal_test.go index 3f8546020811f..e6d15fae0fe9e 100644 --- a/pkg/config/structure/unmarshal_test.go +++ b/pkg/config/structure/unmarshal_test.go @@ -83,6 +83,11 @@ network_devices: assert.Equal(t, trapsCfg.Namespace, "abc") } +type ServiceDescription struct { + Host string + Endpoint Endpoint `mapstructure:",squash"` +} + type Endpoint struct { Name string `yaml:"name"` APIKey string `yaml:"apikey"` @@ -114,6 +119,31 @@ endpoints: assert.Equal(t, endpoints[2].APIKey, "abc3") } +func TestUnmarshalKeyWithSquash(t *testing.T) { + confYaml := ` +service: + host: datad0g.com + name: intake + apikey: abc1 +` + mockConfig := mock.NewFromYAML(t, confYaml) + mockConfig.SetKnown("service") + + var svc = ServiceDescription{} + // fails without EnableSquash being given + err := UnmarshalKey(mockConfig, "service", &svc) + assert.Error(t, err) + assert.Contains(t, err.Error(), "EnableSquash") + + // succeeds + err = UnmarshalKey(mockConfig, "service", &svc, EnableSquash) + assert.NoError(t, err) + + assert.Equal(t, svc.Host, "datad0g.com") + assert.Equal(t, svc.Endpoint.Name, "intake") + assert.Equal(t, svc.Endpoint.APIKey, "abc1") +} + type FeatureConfig struct { Enabled bool `yaml:"enabled"` } @@ -133,6 +163,46 @@ feature: assert.Equal(t, feature.Enabled, true) } +type FeatureConfigDiffCase struct { + ENaBLEd bool +} + +func TestUnmarshalKeyCaseInsensitive(t *testing.T) { + confYaml := ` +feature: + EnABLeD: "true" +` + mockConfig := mock.NewFromYAML(t, confYaml) + mockConfig.SetKnown("feature") + + var feature = FeatureConfig{} + err := UnmarshalKey(mockConfig, "feature", &feature) + assert.NoError(t, err) + + assert.Equal(t, feature.Enabled, true) + + var diffcase = FeatureConfigDiffCase{} + err = UnmarshalKey(mockConfig, "feature", &diffcase) + assert.NoError(t, err) + + assert.Equal(t, diffcase.ENaBLEd, true) +} + +func TestUnmarshalKeyMissing(t *testing.T) { + confYaml := ` +feature: + enabled: "true" +` + mockConfig := mock.NewFromYAML(t, confYaml) + mockConfig.SetKnown("feature") + + // If the data from the config is missing, UnmarshalKey is a no-op, does + // nothing, and returns no error + var endpoints = []Endpoint{} + err := UnmarshalKey(mockConfig, "config_providers", &endpoints) + assert.NoError(t, err) +} + func TestMapGetChildNotFound(t *testing.T) { m := map[string]string{"a": "apple", "b": "banana"} n, err := newNode(reflect.ValueOf(m)) diff --git a/pkg/fleet/daemon/daemon.go b/pkg/fleet/daemon/daemon.go index beeb8aafdfa60..a866814bb2e40 100644 --- a/pkg/fleet/daemon/daemon.go +++ b/pkg/fleet/daemon/daemon.go @@ -371,8 +371,18 @@ func (d *daemonImpl) handleRemoteAPIRequest(request remoteAPIRequest) (err error if err != nil { return fmt.Errorf("could not get installer state: %w", err) } + + c, err := d.installer.ConfigState(request.Package) + if err != nil { + return fmt.Errorf("could not get installer config state: %w", err) + } + versionEqual := request.ExpectedState.InstallerVersion == "" || version.AgentVersion == request.ExpectedState.InstallerVersion - if versionEqual && s.Stable != request.ExpectedState.Stable || s.Experiment != request.ExpectedState.Experiment { + if versionEqual && + (s.Stable != request.ExpectedState.Stable || + s.Experiment != request.ExpectedState.Experiment || + c.Stable != request.ExpectedState.StableConfig || + c.Experiment != request.ExpectedState.ExperimentConfig) { log.Infof("remote request %s not executed as state does not match: expected %v, got %v", request.ID, request.ExpectedState, s) setRequestInvalid(ctx) d.refreshState(ctx) diff --git a/pkg/fleet/daemon/daemon_test.go b/pkg/fleet/daemon/daemon_test.go index 1aa78c95d4b4e..8850fd2f02d6e 100644 --- a/pkg/fleet/daemon/daemon_test.go +++ b/pkg/fleet/daemon/daemon_test.go @@ -310,10 +310,11 @@ func TestRemoteRequest(t *testing.T) { ID: "test-request-1", Method: methodStartExperiment, Package: testExperimentPackage.Name, - ExpectedState: expectedState{InstallerVersion: version.AgentVersion, Stable: testStablePackage.Version}, + ExpectedState: expectedState{InstallerVersion: version.AgentVersion, Stable: testStablePackage.Version, StableConfig: testStablePackage.Version}, Params: versionParamsJSON, } i.pm.On("State", testStablePackage.Name).Return(repository.State{Stable: testStablePackage.Version}, nil).Once() + i.pm.On("ConfigState", testStablePackage.Name).Return(repository.State{Stable: testStablePackage.Version}, nil).Once() i.pm.On("InstallExperiment", mock.Anything, testExperimentPackage.URL).Return(nil).Once() i.rcc.SubmitRequest(testRequest) i.requestsWG.Wait() @@ -322,9 +323,10 @@ func TestRemoteRequest(t *testing.T) { ID: "test-request-2", Method: methodStopExperiment, Package: testExperimentPackage.Name, - ExpectedState: expectedState{InstallerVersion: version.AgentVersion, Stable: testStablePackage.Version, Experiment: testExperimentPackage.Version}, + ExpectedState: expectedState{InstallerVersion: version.AgentVersion, Stable: testStablePackage.Version, Experiment: testExperimentPackage.Version, StableConfig: testStablePackage.Version}, } i.pm.On("State", testStablePackage.Name).Return(repository.State{Stable: testStablePackage.Version, Experiment: testExperimentPackage.Version}, nil).Once() + i.pm.On("ConfigState", testStablePackage.Name).Return(repository.State{Stable: testStablePackage.Version}, nil).Once() i.pm.On("RemoveExperiment", mock.Anything, testExperimentPackage.Name).Return(nil).Once() i.rcc.SubmitRequest(testRequest) i.requestsWG.Wait() @@ -333,9 +335,10 @@ func TestRemoteRequest(t *testing.T) { ID: "test-request-3", Method: methodPromoteExperiment, Package: testExperimentPackage.Name, - ExpectedState: expectedState{InstallerVersion: version.AgentVersion, Stable: testStablePackage.Version, Experiment: testExperimentPackage.Version}, + ExpectedState: expectedState{InstallerVersion: version.AgentVersion, Stable: testStablePackage.Version, Experiment: testExperimentPackage.Version, StableConfig: testStablePackage.Version}, } i.pm.On("State", testStablePackage.Name).Return(repository.State{Stable: testStablePackage.Version, Experiment: testExperimentPackage.Version}, nil).Once() + i.pm.On("ConfigState", testStablePackage.Name).Return(repository.State{Stable: testStablePackage.Version}, nil).Once() i.pm.On("PromoteExperiment", mock.Anything, testExperimentPackage.Name).Return(nil).Once() i.rcc.SubmitRequest(testRequest) i.requestsWG.Wait() diff --git a/pkg/fleet/daemon/remote_config.go b/pkg/fleet/daemon/remote_config.go index d68b8489ad62e..377ab00282620 100644 --- a/pkg/fleet/daemon/remote_config.go +++ b/pkg/fleet/daemon/remote_config.go @@ -183,6 +183,8 @@ type expectedState struct { InstallerVersion string `json:"installer_version"` Stable string `json:"stable"` Experiment string `json:"experiment"` + StableConfig string `json:"stable_config"` + ExperimentConfig string `json:"experiment_config"` } type taskWithVersionParams struct { diff --git a/pkg/logs/auditor/auditor.go b/pkg/logs/auditor/auditor.go index 578107bfa0e22..cad651a7c7d27 100644 --- a/pkg/logs/auditor/auditor.go +++ b/pkg/logs/auditor/auditor.go @@ -133,8 +133,7 @@ func (a *RegistryAuditor) Channel() chan *message.Payload { // GetOffset returns the last committed offset for a given identifier, // returns an empty string if it does not exist. func (a *RegistryAuditor) GetOffset(identifier string) string { - r := a.readOnlyRegistryCopy() - entry, exists := r[identifier] + entry, exists := a.readOnlyRegistryEntryCopy(identifier) if !exists { return "" } @@ -144,8 +143,7 @@ func (a *RegistryAuditor) GetOffset(identifier string) string { // GetTailingMode returns the last committed offset for a given identifier, // returns an empty string if it does not exist. func (a *RegistryAuditor) GetTailingMode(identifier string) string { - r := a.readOnlyRegistryCopy() - entry, exists := r[identifier] + entry, exists := a.readOnlyRegistryEntryCopy(identifier) if !exists { return "" } @@ -265,6 +263,16 @@ func (a *RegistryAuditor) readOnlyRegistryCopy() map[string]RegistryEntry { return r } +func (a *RegistryAuditor) readOnlyRegistryEntryCopy(identifier string) (RegistryEntry, bool) { + a.registryMutex.Lock() + defer a.registryMutex.Unlock() + entry, exists := a.registry[identifier] + if !exists { + return RegistryEntry{}, false + } + return *entry, true +} + // flushRegistry writes on disk the registry at the given path func (a *RegistryAuditor) flushRegistry() error { r := a.readOnlyRegistryCopy() diff --git a/pkg/logs/auditor/go.mod b/pkg/logs/auditor/go.mod index 52a3aba073a47..51a13b17c7628 100644 --- a/pkg/logs/auditor/go.mod +++ b/pkg/logs/auditor/go.mod @@ -16,6 +16,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../config/model 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/utils => ../../config/utils github.com/DataDog/datadog-agent/pkg/logs/message => ../message github.com/DataDog/datadog-agent/pkg/logs/sources => ../sources @@ -43,28 +44,29 @@ require ( 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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.0 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/model 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/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/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/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.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/executable v0.57.0 // 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.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.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/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.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 a57d90a5a1b37..edc28c13218b3 100644 --- a/pkg/logs/client/go.mod +++ b/pkg/logs/client/go.mod @@ -18,6 +18,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../config/model 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/utils => ../../config/utils github.com/DataDog/datadog-agent/pkg/logs/message => ../message github.com/DataDog/datadog-agent/pkg/logs/metrics => ../metrics @@ -46,7 +47,7 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/config/model v0.57.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 @@ -55,32 +56,33 @@ 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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.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.28.0 ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets 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/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.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/setup 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/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/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.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/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.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.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.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.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/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.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/pkg/logs/diagnostic/go.mod b/pkg/logs/diagnostic/go.mod index 6c6616dd4d46d..e8525d5c8999f 100644 --- a/pkg/logs/diagnostic/go.mod +++ b/pkg/logs/diagnostic/go.mod @@ -17,6 +17,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../config/model 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/utils => ../../config/utils github.com/DataDog/datadog-agent/pkg/logs/message => ../message github.com/DataDog/datadog-agent/pkg/logs/sources => ../sources @@ -49,26 +50,27 @@ require ( ) require ( - github.com/DataDog/datadog-agent/comp/core/secrets v0.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.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/model 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/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/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/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.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/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.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/log 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/hostname/validate v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log 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.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.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/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.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/message/go.mod b/pkg/logs/message/go.mod index 9e25811e26e28..2bc00a24443cc 100644 --- a/pkg/logs/message/go.mod +++ b/pkg/logs/message/go.mod @@ -16,6 +16,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../config/model 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/utils => ../../config/utils github.com/DataDog/datadog-agent/pkg/logs/sources => ../sources github.com/DataDog/datadog-agent/pkg/logs/status/utils => ../status/utils @@ -39,28 +40,29 @@ 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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.0 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/model 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/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/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/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.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/executable v0.57.0 // 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.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.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/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.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 4a1f156e04cae..d96d228aa6a18 100644 --- a/pkg/logs/pipeline/go.mod +++ b/pkg/logs/pipeline/go.mod @@ -18,6 +18,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../config/model 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/utils => ../../config/utils github.com/DataDog/datadog-agent/pkg/logs/auditor => ../auditor github.com/DataDog/datadog-agent/pkg/logs/client => ../client @@ -55,7 +56,7 @@ 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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/config/model v0.57.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 @@ -65,7 +66,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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.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 @@ -74,30 +75,31 @@ require ( require ( github.com/DataDog/agent-payload/v5 v5.0.106 // indirect - github.com/DataDog/datadog-agent/comp/core/secrets 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/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.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/setup 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/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/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/metrics 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.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/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.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/hostname/validate v0.57.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.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/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.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.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/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.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 24e11c8274253..6c4fc83034e36 100644 --- a/pkg/logs/processor/go.mod +++ b/pkg/logs/processor/go.mod @@ -17,6 +17,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../config/model 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/utils => ../../config/utils github.com/DataDog/datadog-agent/pkg/logs/diagnostic => ../diagnostic github.com/DataDog/datadog-agent/pkg/logs/message => ../message @@ -47,37 +48,38 @@ 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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/config/model v0.57.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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.0 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/comp/core/secrets v0.57.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.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/setup 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/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/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.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/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.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.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.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.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/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.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 03e37c5ec16da..f21ce07bddc92 100644 --- a/pkg/logs/sds/go.mod +++ b/pkg/logs/sds/go.mod @@ -18,6 +18,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../config/model 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/utils => ../../config/utils github.com/DataDog/datadog-agent/pkg/logs/client => ../client github.com/DataDog/datadog-agent/pkg/logs/message => ../message @@ -46,36 +47,37 @@ replace ( ) require ( - github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/config/model v0.57.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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.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.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.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.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/setup 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/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/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.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/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.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.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.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.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/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.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 a53ad5a116d7d..e8826dfefa489 100644 --- a/pkg/logs/sender/go.mod +++ b/pkg/logs/sender/go.mod @@ -18,6 +18,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../config/model 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/utils => ../../config/utils github.com/DataDog/datadog-agent/pkg/logs/client => ../client github.com/DataDog/datadog-agent/pkg/logs/message => ../message @@ -47,40 +48,41 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/config/model v0.57.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/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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.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.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.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.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/setup 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/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/utils v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/logs/metrics 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.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/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.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/hostname/validate v0.57.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.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/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.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.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/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.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 aca5605c063da..001bee5ca3f81 100644 --- a/pkg/logs/sources/go.mod +++ b/pkg/logs/sources/go.mod @@ -16,6 +16,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../config/model 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/utils => ../../config/utils github.com/DataDog/datadog-agent/pkg/logs/status/utils => ../status/utils github.com/DataDog/datadog-agent/pkg/telemetry => ../../telemetry @@ -38,27 +39,28 @@ 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.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.57.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.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/setup v0.56.0-rc.3 // indirect + 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/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/utils v0.56.0-rc.3 // 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/pkg/util/executable v0.57.0 // 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.0 // 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.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 2e1a8cc78da2c..2d3199639da6c 100644 --- a/pkg/logs/util/testutils/go.mod +++ b/pkg/logs/util/testutils/go.mod @@ -17,6 +17,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ../../../config/mock github.com/DataDog/datadog-agent/pkg/config/model => ../../../config/model 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/utils => ../../../config/utils github.com/DataDog/datadog-agent/pkg/logs/sources => ../../sources github.com/DataDog/datadog-agent/pkg/logs/status/statusinterface => ../../status/statusinterface @@ -41,25 +42,26 @@ 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.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.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.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/setup 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/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/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.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/log 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/executable v0.57.0 // 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.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.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.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/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.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/trace/api/telemetry.go b/pkg/trace/api/telemetry.go index a0eb0bffab17c..a45ac4105042f 100644 --- a/pkg/trace/api/telemetry.go +++ b/pkg/trace/api/telemetry.go @@ -36,6 +36,7 @@ const ( awsLambda cloudResourceType = "AWSLambda" awsFargate cloudResourceType = "AWSFargate" cloudRun cloudResourceType = "GCPCloudRun" + cloudFunctions cloudResourceType = "GCPCloudFunctions" azureAppService cloudResourceType = "AzureAppService" azureContainerApp cloudResourceType = "AzureContainerApp" aws cloudProvider = "AWS" @@ -283,6 +284,12 @@ func (f *TelemetryForwarder) setRequestHeader(req *http.Request) { if serviceName, found := f.conf.GlobalTags["service_name"]; found { req.Header.Set(cloudResourceIdentifierHeader, serviceName) } + case "cloudfunction": + req.Header.Set(cloudProviderHeader, string(gcp)) + req.Header.Set(cloudResourceTypeHeader, string(cloudFunctions)) + if serviceName, found := f.conf.GlobalTags["service_name"]; found { + req.Header.Set(cloudResourceIdentifierHeader, serviceName) + } case "appservice": req.Header.Set(cloudProviderHeader, string(azure)) req.Header.Set(cloudResourceTypeHeader, string(azureAppService)) diff --git a/release.json b/release.json index 789e8d9393fbb..d8a53a0beb73c 100644 --- a/release.json +++ b/release.json @@ -8,7 +8,7 @@ "nightly": { "INTEGRATIONS_CORE_VERSION": "master", "OMNIBUS_SOFTWARE_VERSION": "5d4f6995c19b604d7fc876446e4350ce52b235fb", - "OMNIBUS_RUBY_VERSION": "f3fc847e03ba7081e266b2d333210ba129128a14", + "OMNIBUS_RUBY_VERSION": "db96ee7e2a9269ab864f618d7c447bc22e107fff", "JMXFETCH_VERSION": "0.49.3", "JMXFETCH_HASH": "258085a94d529a6bdf914db36dd50faf6fde2cebc44b1f54a60eb209a5d8917c", "MACOS_BUILD_VERSION": "master", @@ -27,7 +27,7 @@ "nightly-a7": { "INTEGRATIONS_CORE_VERSION": "master", "OMNIBUS_SOFTWARE_VERSION": "5d4f6995c19b604d7fc876446e4350ce52b235fb", - "OMNIBUS_RUBY_VERSION": "f3fc847e03ba7081e266b2d333210ba129128a14", + "OMNIBUS_RUBY_VERSION": "db96ee7e2a9269ab864f618d7c447bc22e107fff", "JMXFETCH_VERSION": "0.49.3", "JMXFETCH_HASH": "258085a94d529a6bdf914db36dd50faf6fde2cebc44b1f54a60eb209a5d8917c", "MACOS_BUILD_VERSION": "master", diff --git a/tasks/gitlab_helpers.py b/tasks/gitlab_helpers.py index 0e347c61997b1..dc2647c1282f7 100644 --- a/tasks/gitlab_helpers.py +++ b/tasks/gitlab_helpers.py @@ -8,10 +8,14 @@ import os import tempfile +import yaml from invoke import task +from invoke.exceptions import Exit +from tasks.kernel_matrix_testing.ci import get_kmt_dashboard_links from tasks.libs.ciproviders.gitlab_api import ( get_all_gitlab_ci_configurations, + get_full_gitlab_ci_configuration, get_gitlab_ci_configuration, get_gitlab_repo, print_gitlab_ci_configuration, @@ -23,6 +27,7 @@ get_test_link_to_job_on_main, ) from tasks.libs.common.color import Color, color_message +from tasks.libs.common.utils import experimental @task @@ -62,7 +67,7 @@ def generate_ci_visibility_links(_ctx, output: str | None): def create_gitlab_annotations_report(ci_job_id: str, ci_job_name: str): - return { + links = { "CI Visibility": [ { "external_link": { @@ -91,6 +96,12 @@ def create_gitlab_annotations_report(ci_job_id: str, ci_job_name: str): ] } + kmt_links = get_kmt_dashboard_links() + if kmt_links: + links["KMT Dashboard"] = kmt_links + + return links + def print_gitlab_object(get_object, ctx, ids, repo='DataDog/datadog-agent', jq: str | None = None, jq_colors=True): """ @@ -136,6 +147,80 @@ def get_job(repo, id): print_gitlab_object(get_job, ctx, ids, repo, jq, jq_colors) +@task +@experimental( + 'This task takes into account only explicit dependencies (job `needs` / `dependencies`), implicit dependencies (stages order) are ignored' +) +def gen_config_subset(ctx, jobs, dry_run=False, force=False): + """ + Will generate a full .gitlab-ci.yml containing only the jobs necessary to run the target jobs `jobs`. + That is, the resulting pipeline will have `jobs` as last jobs to run. + + Warning: This doesn't take implicit dependencies into account (stages order), only explicit dependencies (job `needs` / `dependencies`). + + - dry_run: Print only the new configuration without writing it to the .gitlab-ci.yml file. + - force: Force the update of the .gitlab-ci.yml file even if it has been modified. + + Example: + $ inv gitlab.gen-config-subset tests_deb-arm64-py3 + $ inv gitlab.gen-config-subset tests_rpm-arm64-py3,tests_deb-arm64-py3 --dry-run + """ + + jobs_to_keep = ['cancel-prev-pipelines', 'github_rate_limit_info', 'setup_agent_version'] + attributes_to_keep = 'stages', 'variables', 'default', 'workflow' + + # .gitlab-ci.yml should not be modified + if not force and not dry_run and ctx.run('git status -s .gitlab-ci.yml', hide='stdout').stdout.strip(): + raise Exit(color_message('The .gitlab-ci.yml file should not be modified as it will be overwritten', Color.RED)) + + config = get_full_gitlab_ci_configuration(ctx, '.gitlab-ci.yml') + + jobs = [j for j in jobs.split(',') if j] + jobs_to_keep + required = set() + + def add_dependencies(job): + nonlocal required, config + + if job in required: + return + required.add(job) + + dependencies = [] + if 'needs' in config[job]: + dependencies = config[job]['needs'] + if 'dependencies' in config[job]: + dependencies = config[job]['dependencies'] + + for dep in dependencies: + if isinstance(dep, dict): + dep = dep['job'] + add_dependencies(dep) + + # Make a DFS to find all the jobs that are needed to run the target jobs + for job in jobs: + add_dependencies(job) + + new_config = {job: config[job] for job in required} + + # Remove extends + for job in new_config.values(): + job.pop('extends', None) + + # Keep gitlab config + for attr in attributes_to_keep: + new_config[attr] = config[attr] + + content = yaml.safe_dump(new_config) + + if dry_run: + print(content) + else: + with open('.gitlab-ci.yml', 'w') as f: + f.write(content) + + print(color_message('The .gitlab-ci.yml file has been updated', Color.GREEN)) + + @task def print_job_trace(_, job_id, repo='DataDog/datadog-agent'): """ diff --git a/tasks/kernel_matrix_testing/ci.py b/tasks/kernel_matrix_testing/ci.py index a3cb7c3fc9b39..f6e83fcb6e571 100644 --- a/tasks/kernel_matrix_testing/ci.py +++ b/tasks/kernel_matrix_testing/ci.py @@ -1,10 +1,12 @@ from __future__ import annotations +import datetime import io import json import os import re import tarfile +import urllib.parse import xml.etree.ElementTree as ET from typing import TYPE_CHECKING, overload @@ -250,3 +252,47 @@ def get_all_jobs_for_pipeline(pipeline_id: int | str) -> tuple[list[KMTSetupEnvJ break return setup_jobs, test_jobs + + +def get_kmt_dashboard_links() -> None | list: + stage = os.environ.get("CI_JOB_STAGE") + pipeline = os.environ.get("CI_PIPELINE_ID") + branch = os.environ.get("CI_COMMIT_REF_NAME") + pipeline_start = os.environ.get("CI_PIPELINE_CREATED_AT") + + # Check we're running in Gitlab CI + if pipeline_start is None or branch is None or pipeline is None or stage is None: + return None + + # Check this is a KMT job + if "kernel_matrix_testing" not in stage: + return None + + try: + pipeline_start_date = datetime.datetime.fromisoformat(pipeline_start) + except Exception: + print(f"Error: Could not parse pipeline start date {pipeline_start}") + return None + + dashboard_end = pipeline_start_date + datetime.timedelta(hours=4) + + query_args = { + "fromUser": "false", + "refresh_mode": "paused", + "tpl_var_ci.pipeline.id[0]": pipeline, + "tpl_var_git-branch[0]": branch, + "from_ts": int(pipeline_start_date.timestamp()) * 1000, + "to_ts": int(dashboard_end.timestamp()) * 1000, + "live": "false", + } + + url = f"https://app.datadoghq.com/dashboard/zs9-uia-gsg?{urllib.parse.urlencode(query_args)}" + + return [ + { + "external_link": { + "label": "KMT: Pipeline dashboard", + "url": url, + } + } + ] diff --git a/tasks/kmt.py b/tasks/kmt.py index 7db89e1bd79b1..685e41e0370a6 100644 --- a/tasks/kmt.py +++ b/tasks/kmt.py @@ -411,11 +411,8 @@ def config_ssh_key(ctx: Context): ssh_keys = [] for f in ssh_key_files: - key_comment = get_ssh_key_name(f.with_suffix(".pub")) - if key_comment is None: - warn(f"[x] {f} does not have a valid key name, cannot be used") - else: - ssh_keys.append({'path': os.fspath(f), 'name': key_comment, 'aws_key_name': ''}) + key_name = get_ssh_key_name(f.with_suffix(".pub")) or f.name + ssh_keys.append({'path': os.fspath(f), 'name': key_name, 'aws_key_name': ''}) keys_str = "\n".join([f" - [{i + 1}] {key['name']} (path: {key['path']})" for i, key in enumerate(ssh_keys)]) result = ask(f"[?] Found these valid key files:\n{keys_str}\nChoose one of these files (1-{len(ssh_keys)}): ") @@ -426,6 +423,10 @@ def config_ssh_key(ctx: Context): except IndexError as e: # out of range raise Exit(f"Invalid choice {result}, must be a number between 1 and {len(ssh_keys)} (inclusive)") from e + info("[+] KMT needs this SSH key to be loaded in AWS so that it can be used to access the instances") + info( + "[+] If you haven't loaded it yet, go to https://dtdg.co/aws-sso-prod -> DataDog Sandbox -> EC2 -> Network & Security -> Key Pairs" + ) aws_key_name = ask( f"Enter the key name configured in AWS for this key (leave blank to set the same as the local key name '{ssh_key['name']}'): " ) @@ -872,12 +873,12 @@ def build_run_config(run: str | None, packages: list[str]): return c -def build_target_packages(filter_packages): - all_packages = go_package_dirs(TEST_PACKAGES_LIST, [NPM_TAG, BPF_TAG]) - if filter_packages == []: +def build_target_packages(filter_packages: list[str], build_tags: list[str]): + all_packages = go_package_dirs(TEST_PACKAGES_LIST, build_tags) + if not filter_packages: return all_packages - filter_packages = [os.path.relpath(p) for p in go_package_dirs(filter_packages, [NPM_TAG, BPF_TAG])] + filter_packages = [os.path.relpath(p) for p in go_package_dirs(filter_packages, build_tags)] return [pkg for pkg in all_packages if os.path.relpath(pkg) in filter_packages] @@ -887,9 +888,8 @@ def build_object_files(ctx, fp, arch: Arch): ctx.run(f"ninja -d explain -f {fp}") -def compute_package_dependencies(ctx: Context, packages: list[str]) -> dict[str, set[str]]: +def compute_package_dependencies(ctx: Context, packages: list[str], build_tags: list[str]) -> dict[str, set[str]]: dd_pkg_name = "github.com/DataDog/datadog-agent/" - build_tags = get_sysprobe_buildtags(False, False) pkg_deps: dict[str, set[str]] = defaultdict(set) packages_list = " ".join(packages) @@ -923,7 +923,6 @@ def kmt_sysprobe_prepare( ctx: Context, arch: str | Arch, stack: str | None = None, - kernel_release: str | None = None, packages=None, extra_arguments: str | None = None, ci: bool = False, @@ -956,8 +955,9 @@ def kmt_sysprobe_prepare( build_object_files(ctx, f"{kmt_paths.arch_dir}/kmt-object-files.ninja", arch) info("[+] Computing Go dependencies for test packages...") - target_packages = build_target_packages(filter_pkgs) - pkg_deps = compute_package_dependencies(ctx, target_packages) + build_tags = get_sysprobe_buildtags(False, False) + target_packages = build_target_packages(filter_pkgs, build_tags) + pkg_deps = compute_package_dependencies(ctx, target_packages, build_tags) info("[+] Generating build instructions..") with open(nf_path, 'w') as ninja_file: @@ -976,6 +976,7 @@ def kmt_sysprobe_prepare( ninja_build_dependencies(ctx, nw, kmt_paths, go_path, arch) ninja_copy_ebpf_files(nw, "system-probe", kmt_paths, arch) + build_tags = get_sysprobe_buildtags(False, False) for pkg in target_packages: pkg_name = os.path.relpath(pkg, os.getcwd()) target_path = os.path.join(kmt_paths.sysprobe_tests, pkg_name) @@ -983,7 +984,7 @@ def kmt_sysprobe_prepare( variables = { "env": env_str, "go": go_path, - "build_tags": get_sysprobe_buildtags(False, False), + "build_tags": build_tags, } timeout = get_test_timeout(os.path.relpath(pkg, os.getcwd())) if timeout: @@ -1015,9 +1016,9 @@ def kmt_sysprobe_prepare( rule="copyfiles", ) - # handle testutils and testdata seperately since they are + # handle testutils and testdata separately since they are # shared across packages - target_pkgs = build_target_packages([]) + target_pkgs = build_target_packages([], build_tags) for pkg in target_pkgs: target_path = os.path.join(kmt_paths.sysprobe_tests, os.path.relpath(pkg, os.getcwd())) diff --git a/tasks/libs/ciproviders/gitlab_api.py b/tasks/libs/ciproviders/gitlab_api.py index aca64558b382f..a6022e828893e 100644 --- a/tasks/libs/ciproviders/gitlab_api.py +++ b/tasks/libs/ciproviders/gitlab_api.py @@ -294,7 +294,7 @@ def str_note() -> list[str]: if only_summary: if not cli: - res.append(':warning: Diff too large to display on Github') + res.append(':warning: Diff too large to display on Github.') else: if self.modified: wrap = len(self.modified) > max_detailed_jobs @@ -382,7 +382,7 @@ def display(self, cli: bool = True, job_url: str = None, **kwargs) -> str: return '' if len(self.diffs) == 1: - return self.diffs[0].diff.display(cli, **kwargs) + return self.diffs[0].diff.display(cli, job_url=job_url, **kwargs) def str_entry(diff: MultiGitlabCIDiff.MultiDiff) -> str: if cli: diff --git a/tasks/libs/common/utils.py b/tasks/libs/common/utils.py index 8b2e04244bb52..fe5d4710113c3 100644 --- a/tasks/libs/common/utils.py +++ b/tasks/libs/common/utils.py @@ -725,3 +725,23 @@ def download_to_tempfile(url, checksum=None): os.close(fd) if os.path.exists(tmp_path): os.remove(tmp_path) + + +def experimental(message): + """ + Marks this task as experimental and prints the message. + + Note: This decorator must be placed after the `task` decorator. + """ + + def decorator(f): + @wraps(f) + def wrapper(*args, **kwargs): + fname = f.__name__ + print(color_message(f"Warning: {fname} is experimental: {message}", Color.ORANGE), file=sys.stderr) + + return f(*args, **kwargs) + + return wrapper + + return decorator diff --git a/tasks/linter.py b/tasks/linter.py index a2a41e29cb8c0..10aa5af3b9ef6 100644 --- a/tasks/linter.py +++ b/tasks/linter.py @@ -613,7 +613,9 @@ def contains_valid_change_rule(rule): tests_without_change_path = defaultdict(list) tests_without_change_path_allowed = defaultdict(list) for test, filepath in tests: - if not any(contains_valid_change_rule(rule) for rule in config[test]['rules'] if isinstance(rule, dict)): + if "rules" in config[test] and not any( + contains_valid_change_rule(rule) for rule in config[test]['rules'] if isinstance(rule, dict) + ): if test in tests_without_change_path_allow_list: tests_without_change_path_allowed[filepath].append(test) else: diff --git a/tasks/modules.py b/tasks/modules.py index 009a15c81c97f..276f8106a753d 100644 --- a/tasks/modules.py +++ b/tasks/modules.py @@ -218,6 +218,7 @@ def dependency_path(self, agent_version): "pkg/config/model": GoModule("pkg/config/model", independent=True, used_by_otel=True), "pkg/config/remote": GoModule("pkg/config/remote", independent=True), "pkg/config/setup": GoModule("pkg/config/setup", independent=True, used_by_otel=True), + "pkg/config/structure": GoModule("pkg/config/structure", independent=True, used_by_otel=True), "pkg/config/utils": GoModule("pkg/config/utils", independent=True, used_by_otel=True), "pkg/errors": GoModule("pkg/errors", independent=True), "pkg/gohai": GoModule("pkg/gohai", independent=True, importable=False), @@ -282,9 +283,6 @@ def dependency_path(self, agent_version): "pkg/util/uuid": GoModule("pkg/util/uuid", independent=True), "pkg/util/winutil": GoModule("pkg/util/winutil", independent=True, used_by_otel=True), "pkg/version": GoModule("pkg/version", independent=True, used_by_otel=True), - "test/e2e/containers/otlp_sender": GoModule( - "test/e2e/containers/otlp_sender", condition=lambda: False, should_tag=False - ), "test/fakeintake": GoModule("test/fakeintake", independent=True), "test/new-e2e": GoModule( "test/new-e2e", diff --git a/tasks/omnibus.py b/tasks/omnibus.py index af0aff2706ff9..46edb5fcef9b6 100644 --- a/tasks/omnibus.py +++ b/tasks/omnibus.py @@ -90,6 +90,7 @@ def get_omnibus_env( go_mod_cache=None, flavor=AgentFlavor.base, pip_config_file="pip.conf", + custom_config_dir=None, fips_mode=False, ): env = load_release_versions(ctx, release_version) @@ -134,6 +135,9 @@ def get_omnibus_env( env['SYSTEM_PROBE_BIN'] = system_probe_bin env['AGENT_FLAVOR'] = flavor.name + if custom_config_dir: + env["OUTPUT_CONFIG_DIR"] = custom_config_dir + if fips_mode: env['FIPS_MODE'] = 'true' @@ -181,6 +185,7 @@ def build( pip_config_file="pip.conf", host_distribution=None, install_directory=None, + config_directory=None, target_project=None, fips_mode=False, ): @@ -213,6 +218,7 @@ def build( go_mod_cache=go_mod_cache, flavor=flavor, pip_config_file=pip_config_file, + custom_config_dir=config_directory, fips_mode=fips_mode, ) @@ -252,7 +258,7 @@ def build( # For instance if git_cache_dir is set to "/git/cache/dir" and install_dir is # set to /a/b/c, the cache git repository will be located in # /git/cache/dir/a/b/c/.git - if install_directory is None: + if not install_directory: install_directory = install_dir_for_project(target_project) # Is the path starts with a /, it's considered the new root for the joined path # which effectively drops whatever was in omnibus_cache_dir @@ -385,3 +391,41 @@ def manifest( omnibus_s3_cache=False, log_level=log_level, ) + + +@task +def rpath_edit(ctx, install_path, target_rpath_dd_folder, platform="linux"): + # Collect mime types for all files inside the Agent installation + files = ctx.run(rf"find {install_path} -type f -exec file --mime-type \{{\}} \+", hide=True).stdout + for line in files.splitlines(): + if not line: + continue + file, file_type = line.split(":") + file_type = file_type.strip() + + if platform == "linux": + if file_type not in ["application/x-executable", "inode/symlink", "application/x-sharedlib"]: + continue + binary_rpath = ctx.run(f'objdump -x {file} | grep "RPATH"', warn=True, hide=True).stdout + else: + if file_type != "application/x-mach-binary": + continue + binary_rpath = ctx.run(f'otool -l {file} | grep -A 2 "RPATH"', warn=True, hide=True).stdout + + if install_path in binary_rpath: + new_rpath = os.path.relpath(target_rpath_dd_folder, os.path.dirname(file)) + if platform == "linux": + ctx.run(f"patchelf --force-rpath --set-rpath \\$ORIGIN/{new_rpath}/embedded/lib {file}") + else: + # The macOS agent binary has 18 RPATH definition, replacing the first one should be enough + # but just in case we're replacing them all. + # We're also avoiding unnecessary `install_name_tool` call as much as possible. + number_of_rpaths = binary_rpath.count('\n') // 3 + for _ in range(number_of_rpaths): + exit_code = ctx.run( + f"install_name_tool -rpath {install_path}/embedded/lib @loader_path/{new_rpath}/embedded/lib {file}", + warn=True, + hide=True, + ).exited + if exit_code != 0: + break diff --git a/tasks/pipeline.py b/tasks/pipeline.py index b0090e3acc106..7fecea7b19d82 100644 --- a/tasks/pipeline.py +++ b/tasks/pipeline.py @@ -1027,7 +1027,7 @@ def compare_to_itself(ctx): ctx.run("git config --global user.email 'github-app[bot]@users.noreply.github.com'", hide=True) # The branch must exist in gitlab to be able to "compare_to" # Push an empty commit to prevent linking this pipeline to the actual PR - ctx.run("git commit -m 'Compare to itself' --allow-empty", hide=True) + ctx.run("git commit -m 'Initial push of the compare/to branch' --allow-empty", hide=True) ctx.run(f"git push origin {new_branch}") from tasks.libs.releasing.json import load_release_json @@ -1040,7 +1040,7 @@ def compare_to_itself(ctx): with open(file, 'w') as f: f.write(content.replace(f'compare_to: {release_json["base_branch"]}', f'compare_to: {new_branch}')) - ctx.run("git commit -am 'Compare to itself'", hide=True) + ctx.run("git commit -am 'Commit to compare to itself'", hide=True) ctx.run(f"git push origin {new_branch}", hide=True) max_attempts = 6 compare_to_pipeline = None diff --git a/tasks/system_probe.py b/tasks/system_probe.py index 9128b8f6f6336..37eb498e2a386 100644 --- a/tasks/system_probe.py +++ b/tasks/system_probe.py @@ -849,7 +849,6 @@ def go_package_dirs(packages, build_tags): This handles the ellipsis notation (eg. ./pkg/ebpf/...) """ - target_packages = [] format_arg = '{{ .Dir }}' buildtags_arg = ",".join(build_tags) packages_arg = " ".join(packages) diff --git a/tasks/unit_tests/pipeline_tests.py b/tasks/unit_tests/pipeline_tests.py index a418bc1fbb67d..366fc3b54bb92 100644 --- a/tasks/unit_tests/pipeline_tests.py +++ b/tasks/unit_tests/pipeline_tests.py @@ -106,9 +106,9 @@ class TestCompareToItself(unittest.TestCase): "git remote set-url origin https://x-access-token:zidane@github.com/DataDog/datadog-agent.git": Result(), "git config --global user.name 'github-actions[bot]'": Result(), "git config --global user.email 'github-app[bot]@users.noreply.github.com'": Result(), - "git commit -m 'Compare to itself' --allow-empty": Result(), + "git commit -m 'Initial push of the compare/to branch' --allow-empty": Result(), "git push origin compare/Football/900284400": Result(), - "git commit -am 'Compare to itself'": Result(), + "git commit -am 'Commit to compare to itself'": Result(), "git checkout Football": Result(), "git branch -D compare/Football/900284400": Result(), "git push origin :compare/Football/900284400": Result(), diff --git a/test/e2e/README.md b/test/e2e/README.md deleted file mode 100644 index 5bf55766a9b76..0000000000000 --- a/test/e2e/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# End to End testing - -# ToC -- [How it works](#how-it-works) - * [Setup instance](#setup-instance) - * [Run instance](#run-instance) - * [Command line](#command-line) - * [AWS development](#aws-development) - * [Locally](#locally) -- [Argo workflow](#argo-workflow) - * [argo assertion](#argo-assertion) - * [argo container](#argo-container) -- [Upgrade](#upgrade---bump) - -# How it works - -There are 3 main directories: -- [argo-workflows](./argo-workflows) - Specification of the end to end testing - -- [containers](./containers) - Custom container images needed within the workflows - -- [scripts](./scripts) - - [`setup-instance`](./scripts/setup-instance) - Entrypoint and scripts dedicated for environments (locally, AWS dev, AWS gitlab) - - [`run-instance`](./scripts/run-instance) - Scripts executed in the argo-machine (locally, AWS instance) - -## `setup-instance` - - - -## `run-instance` - - - -## Command line - -### AWS development - -```bash -$ cd ${GOPATH}/src/github.com/DataDog/datadog-agent -$ aws-vault exec ${DEV} -- inv -e e2e-tests -t dev --agent-image datadog/agent-dev:master --dca-image datadog/cluster-agent-dev:master -``` - -### Locally (Linux only) - -```bash -$ inv -e e2e-tests -t local --agent-image datadog/agent-dev:master --dca-image datadog/cluster-agent-dev:master -``` - -# Argo workflow - -The argo documentation is available [here](https://argo-cd.readthedocs.io/en/stable/), there are a lot of examples [here](https://github.com/argoproj/argo/tree/master/examples) too. - -## Argo assertion - -To assert something in an argo workflow, you need to create a mongodb query: -```yaml -name: find-kubernetes-state-deployments -activeDeadlineSeconds: 200 -script: - image: mongo:3.6.3 - command: [mongo, "fake-datadog.default.svc.cluster.local/datadog"] - source: | - while (1) { - var nb = db.series.find({ - metric: "kubernetes_state.deployment.replicas_available", - tags: {$all: ["namespace:default", "deployment:fake-datadog"] }, - "points.0.1": { $eq: 1} }); - print("find: " + nb) - if (nb != 0) { - break; - } - prevNb = nb; - sleep(2000); - } -``` - -This is an infinite loop with a timeout set by `activeDeadlineSeconds: 200`. -The source is EOF to the command, equivalent to: -```bash -mongo "fake-datadog.default.svc.cluster.local/datadog" << EOF -while (1) -[...] -EOF -``` - -Try to maximise the usage of MongoDB query system without rewriting too much logic in JavaScript. - -See some examples [here](./containers/fake_datadog/README.md#find) - -To discover more MongoDB capabilities: -- [find](https://docs.mongodb.com/manual/tutorial/query-documents/) -- [aggregation](https://docs.mongodb.com/manual/aggregation/) - -## Argo container - -If you need to add a non existing public container in the workflow, create it in the [container directory](./containers). - -But, keep in mind this become an additional piece of software to maintain. - -# Upgrade - bump - -This section helps you to upgrade any part of the end to end testing. - -The current end to end testing pipeline relies on: -* [Argo](https://github.com/argoproj/argo) - -Upgrade Argo version by changing version in `test/e2e/scripts/run-instance/20-argo-download.sh` and setting new checksum value in `test/e2e/scripts/run-instance/argo.sha512sum` - -* [Kind](https://kind.sigs.k8s.io/) - -Upgrade Kind version by changing version in `test/e2e/scripts/run-instance/10-setup-kind.sh`. -By default Kind will use the latest stable Kubernetes known at the time of Kind release. - -* [Fedora CoreOS](https://getfedora.org/en/coreos?stream=stable) - -You don't need to update CoreOS version as the setup script (`test/e2e/scripts/setup-instance/00-entrypoint-[dev|gitlab].sh`) always uses the latest `stable` version by default. - -If needed, use the [ignition-linter](https://coreos.com/validate/) to validate any changes. diff --git a/test/e2e/argo-workflows/cspm-workflow.yaml b/test/e2e/argo-workflows/cspm-workflow.yaml deleted file mode 100644 index c124dbf807d74..0000000000000 --- a/test/e2e/argo-workflows/cspm-workflow.yaml +++ /dev/null @@ -1,121 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Workflow -metadata: - generateName: argo-datadog-agent- -spec: - entrypoint: main - onExit: exit-handler - arguments: - parameters: - - name: datadog-agent-image-repository - - name: datadog-agent-image-tag - - name: datadog-agent-site - - name: datadog-cluster-agent-image-repository - - name: datadog-cluster-agent-image-tag - - name: ci_commit_short_sha - - name: ci_pipeline_id - - name: ci_job_id - volumes: - - name: datadog-agent-volume - hostPath: - path: /host/datadog-agent - - name: host-root-proc - hostPath: - path: /proc - templates: - - name: main - inputs: - parameters: - - name: datadog-agent-image-repository - - name: datadog-agent-image-tag - - name: datadog-agent-site - - name: datadog-cluster-agent-image-repository - - name: datadog-cluster-agent-image-tag - - name: ci_commit_short_sha - - name: ci_pipeline_id - - name: ci_job_id - steps: - - - name: start-fake-datadog - templateRef: - name: fake-datadog - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: start-dsd-hostname - templateRef: - name: dsd-hostname - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - - name: start-datadog-agent - templateRef: - name: datadog-agent - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - name: agent-image-repository - value: "{{inputs.parameters.datadog-agent-image-repository}}" - - name: agent-image-tag - value: "{{inputs.parameters.datadog-agent-image-tag}}" - - name: cluster-agent-image-repository - value: "{{inputs.parameters.datadog-cluster-agent-image-repository}}" - - name: cluster-agent-image-tag - value: "{{inputs.parameters.datadog-cluster-agent-image-tag}}" - - name: site - value: "{{inputs.parameters.datadog-agent-site}}" - - name: dd-url - value: "" - - name: ci_commit_short_sha - value: "{{inputs.parameters.ci_commit_short_sha}}" - - name: ci_pipeline_id - value: "{{inputs.parameters.ci_pipeline_id}}" - - name: ci_job_id - value: "{{inputs.parameters.ci_job_id}}" - - name: remote_configuration_enabled - value: "false" - - name: networkmonitoring_enabled - value: "false" - - - - name: wait-datadog-agent - templateRef: - name: datadog-agent - template: wait - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - - name: test-cspm-e2e - templateRef: - name: datadog-agent - template: test-cspm-e2e - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - name: site - value: "{{inputs.parameters.datadog-agent-site}}" - - - name: exit-handler - steps: - - - name: diagnose - template: diagnose - - - name: diagnose - steps: - - - name: diagnose-datadog-agent - templateRef: - name: datadog-agent - template: diagnose - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" diff --git a/test/e2e/argo-workflows/default-workflow.yaml b/test/e2e/argo-workflows/default-workflow.yaml deleted file mode 100644 index 9c9f54e30d89c..0000000000000 --- a/test/e2e/argo-workflows/default-workflow.yaml +++ /dev/null @@ -1,352 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Workflow -metadata: - generateName: argo-datadog-agent- -spec: - entrypoint: main - onExit: exit-handler - arguments: - parameters: - - name: datadog-agent-image-repository - - name: datadog-agent-image-tag - - name: datadog-cluster-agent-image-repository - - name: datadog-cluster-agent-image-tag - - name: ci_commit_short_sha - - name: ci_pipeline_id - - name: ci_job_id - volumes: - - name: datadog-agent-volume - hostPath: - path: /host/datadog-agent - templates: - - name: main - inputs: - parameters: - - name: datadog-agent-image-repository - - name: datadog-agent-image-tag - - name: datadog-cluster-agent-image-repository - - name: datadog-cluster-agent-image-tag - - name: ci_commit_short_sha - - name: ci_pipeline_id - - name: ci_job_id - steps: - - - name: start-fake-datadog - templateRef: - name: fake-datadog - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: start-redis - templateRef: - name: redis - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: start-cpu-stress - templateRef: - name: cpu-stress - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: start-dsd-hostname - templateRef: - name: dsd-hostname - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: start-logs-hello-world - templateRef: - name: logs-hello-world - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: start-nginx - templateRef: - name: nginx - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - - name: fake-dd-reset - templateRef: - name: fake-datadog - template: reset - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - - name: start-datadog-agent - templateRef: - name: datadog-agent - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - name: agent-image-repository - value: "{{inputs.parameters.datadog-agent-image-repository}}" - - name: agent-image-tag - value: "{{inputs.parameters.datadog-agent-image-tag}}" - - name: dd-url - value: "http://fake-datadog.{{workflow.namespace}}.svc.cluster.local" - - name: site - value: "" - - name: cluster-agent-image-repository - value: "{{inputs.parameters.datadog-cluster-agent-image-repository}}" - - name: cluster-agent-image-tag - value: "{{inputs.parameters.datadog-cluster-agent-image-tag}}" - - name: ci_commit_short_sha - value: "{{inputs.parameters.ci_commit_short_sha}}" - - name: ci_pipeline_id - value: "{{inputs.parameters.ci_pipeline_id}}" - - name: ci_job_id - value: "{{inputs.parameters.ci_job_id}}" - - name: remote_configuration_enabled - value: "false" - - name: networkmonitoring_enabled - value: "false" - - - - name: wait-datadog-agent - templateRef: - name: datadog-agent - template: wait - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - - name: start-busybox - templateRef: - name: busybox - template: create - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - - name: test-datadog-agent - templateRef: - name: datadog-agent - template: test - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: test-redis - templateRef: - name: redis - template: test - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: test-cpu - templateRef: - name: cpu-stress - template: test - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: test-dsd - templateRef: - name: dsd-hostname - template: test - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: test-nginx - templateRef: - name: nginx - template: test - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: test-busybox - templateRef: - name: busybox - template: test - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - - name: stop-redis - templateRef: - name: redis - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: stop-nginx - templateRef: - name: nginx - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - - name: no-more-redis - templateRef: - name: redis - template: no-more-metrics - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: no-more-nginx - templateRef: - name: nginx - template: no-more-metrics - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: exit-handler - steps: - - - name: delete - template: delete - when: "{{workflow.status}} == Succeeded" - - - name: diagnose - template: diagnose - when: "{{workflow.status}} != Succeeded" - - - name: delete - steps: - - - name: stop-datadog-agent - templateRef: - name: datadog-agent - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: stop-redis - templateRef: - name: redis - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: stop-cpu-stress - templateRef: - name: cpu-stress - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: stop-dsd-hostname - templateRef: - name: dsd-hostname - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: stop-logs-hello-world - templateRef: - name: logs-hello-world - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: stop-nginx - templateRef: - name: nginx - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: stop-fake-datadog - templateRef: - name: fake-datadog - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: stop-busybox - templateRef: - name: busybox - template: delete - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - - name: diagnose - steps: - - - name: diagnose-datadog-agent - templateRef: - name: datadog-agent - template: diagnose - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - name: diagnose-fake-datadog - templateRef: - name: fake-datadog - template: diagnose - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - name: diagnose-nginx - templateRef: - name: nginx - template: diagnose - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" - - name: diagnose-busybox - templateRef: - name: busybox - template: diagnose - arguments: - parameters: - - name: namespace - value: "{{workflow.namespace}}" diff --git a/test/e2e/argo-workflows/templates/cpu-stress.yaml b/test/e2e/argo-workflows/templates/cpu-stress.yaml deleted file mode 100644 index e210d9aa0eaf2..0000000000000 --- a/test/e2e/argo-workflows/templates/cpu-stress.yaml +++ /dev/null @@ -1,175 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: WorkflowTemplate -metadata: - name: cpu-stress -spec: - templates: - - name: create - inputs: - parameters: - - name: namespace - resource: - action: apply - manifest: | - apiVersion: apps/v1 - kind: Deployment - metadata: - name: cpu-stress - namespace: {{inputs.parameters.namespace}} - spec: - replicas: 1 - selector: - matchLabels: - app: cpu-stress - template: - metadata: - labels: - app: cpu-stress - spec: - containers: - - name: cpu-stress - image: datadog/docker-library:progrium_stress - args: - - "--cpu" - - "2" - resources: - requests: - memory: "64Mi" - cpu: "1" - limits: - memory: "64Mi" - cpu: "1" - - - name: delete - inputs: - parameters: - - name: namespace - resource: - action: delete - manifest: | - apiVersion: apps/v1 - kind: Deployment - metadata: - name: cpu-stress - namespace: {{inputs.parameters.namespace}} - - - name: find-metrics-cpu-container-runtime - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: mongo:4.4.1 - command: [mongo, "fake-datadog.{{inputs.parameters.namespace}}.svc.cluster.local/datadog"] - source: | - while (1) { - var nb = db.series.find({ - metric: "cri.cpu.usage", - tags: { $all: ["kube_deployment:cpu-stress", "kube_container_name:cpu-stress"] }, - "points.0.1": { $gt: 950000000, $lt: 1010000000 } }).count(); - print("find: " + nb) - if (nb != 0) { - print("cpu value in target range") - break; - } - sleep(2000); - } - - - name: find-metrics-cpu-kubelet - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: mongo:4.4.1 - command: [mongo, "fake-datadog.{{inputs.parameters.namespace}}.svc.cluster.local/datadog"] - source: | - while (1) { - var nb = db.series.find({ - metric: "kubernetes.cpu.usage.total", - tags: { $all: ["kube_deployment:cpu-stress", "kube_container_name:cpu-stress"] }, - "points.0.1": { $gt: 800000000, $lt: 1200000000 } }).count(); - print("find: " + nb) - if (nb != 0) { - print("cpu value in target range") - break; - } - sleep(2000); - } - - - name: find-metrics-cpu-system - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: mongo:4.4.1 - command: [mongo, "fake-datadog.{{inputs.parameters.namespace}}.svc.cluster.local/datadog"] - source: | - while (1) { - sleep(2000); - - // Determine the hostname the cpu-stress pod is running on - var point = db.series.find({ - metric: "kubernetes.cpu.usage.total", - tags: {$all: ["kube_deployment:cpu-stress", "kube_container_name:cpu-stress"]} - }).limit(1).sort({$natural:-1})[0]; - if (!point) { - print("cannot get hostname for pod"); - continue; - } - hostname = point.host; - - // Get the number of CPUs on that host - var point = db.series.find({ - metric: "kubernetes_state.node.cpu_capacity", - host: hostname - }).limit(1).sort({$natural:-1})[0]; - if (!point) { - print("cannot get cpu capacity for host " + hostname); - continue; - } - cpucount = point.points[0][1]; - print("cpu count: " + cpucount) - - // Get the user CPU usage, make sure it's above 39% non-normalized - var point = db.series.find({ - metric: "system.cpu.user", - host: hostname - }).limit(1).sort({$natural:-1})[0]; - if (!point) { - print("no system.cpu.usage metric reported for host " + hostname) - continue; - } - print("raw value: " + point.points[0][1]) - value = point.points[0][1] * cpucount; - print("cpu value: " + value) - if (value > 95) { - print("cpu value in target range"); - break; - } - } - - - name: test - inputs: - parameters: - - name: namespace - steps: - - - name: find-metrics-cpu-container-runtime - template: find-metrics-cpu-container-runtime - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: find-metrics-cpu-kubelet - template: find-metrics-cpu-kubelet - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: find-metrics-cpu-system - template: find-metrics-cpu-system - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" diff --git a/test/e2e/argo-workflows/templates/datadog-agent.yaml b/test/e2e/argo-workflows/templates/datadog-agent.yaml deleted file mode 100644 index 2c040444f3104..0000000000000 --- a/test/e2e/argo-workflows/templates/datadog-agent.yaml +++ /dev/null @@ -1,666 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: WorkflowTemplate -metadata: - name: datadog-agent -spec: - templates: - - name: create - inputs: - parameters: - - name: namespace - - name: dd-url - - name: site - - name: agent-image-repository - - name: agent-image-tag - - name: cluster-agent-image-repository - - name: cluster-agent-image-tag - - name: ci_commit_short_sha - - name: ci_pipeline_id - - name: ci_job_id - - name: remote_configuration_enabled - - name: networkmonitoring_enabled - script: - image: alpine/k8s:1.27.1 - envFrom: - - secretRef: - name: dd-keys - command: [sh] - source: | - set -euo pipefail - - cat > /tmp/values.yaml <& /dev/null - sleep 0.01 - done ) & - - until [[ "$(kubectl --namespace {{inputs.parameters.namespace}} get hpa nginxext -o jsonpath='{.status.currentReplicas}')" -gt 1 ]]; do - kubectl --namespace {{inputs.parameters.namespace}} describe hpa nginxext - sleep 1 - done - - - name: test - inputs: - parameters: - - name: namespace - dag: - tasks: - - name: find-kube-state-metrics - template: find-kube-state-metrics - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: find-metrics-nginx - template: find-metrics-nginx - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: validate-hpa - template: validate-hpa - dependencies: - - find-metrics-nginx - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: run-hpa - template: run-hpa - dependencies: - - validate-hpa - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - - name: no-more-metrics - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: mongo:4.4.1 - command: [mongo, "fake-datadog.{{inputs.parameters.namespace}}.svc.cluster.local/datadog"] - source: | - var prevNb = -1; - while (1) { - var nb = db.series.find({ - metric: {$regex: "nginx*"} - }).count(); - - print("prev-find: " + prevNb) - print("find: " + nb) - if (nb == prevNb) { - break; - } - prevNb = nb; - sleep(30000); - } - - - name: describe-hpa - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: alpine/k8s:1.27.1 - command: [sh] - source: | - set -euo pipefail - - kubectl --namespace {{inputs.parameters.namespace}} describe hpa nginxext - - - name: diagnose - inputs: - parameters: - - name: namespace - steps: - - - name: describe-hpa - template: describe-hpa - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" diff --git a/test/e2e/argo-workflows/templates/redis.yaml b/test/e2e/argo-workflows/templates/redis.yaml deleted file mode 100644 index df3cbf79ea615..0000000000000 --- a/test/e2e/argo-workflows/templates/redis.yaml +++ /dev/null @@ -1,366 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: WorkflowTemplate -metadata: - name: redis -spec: - templates: - - name: create-service - inputs: - parameters: - - name: namespace - resource: - action: apply - manifest: | - apiVersion: v1 - kind: Service - metadata: - name: redis - namespace: {{inputs.parameters.namespace}} - spec: - ports: - - port: 6379 - protocol: TCP - targetPort: 6379 - name: redis - selector: - app: redis - type: ClusterIP - - - name: create-deployment - inputs: - parameters: - - name: namespace - resource: - action: apply - manifest: | - apiVersion: apps/v1 - kind: Deployment - metadata: - name: redis - namespace: {{inputs.parameters.namespace}} - spec: - selector: - matchLabels: - app: redis - replicas: 1 - template: - metadata: - labels: - app: redis - annotations: - ad.datadoghq.com/redis.check_names: '["redisdb"]' - ad.datadoghq.com/redis.init_configs: '[{}]' - ad.datadoghq.com/redis.instances: '[{"host": "%%host%%", "port": "%%port%%"}]' - spec: - initContainers: - - name: useless - image: busybox:latest - command: - - /bin/true - resources: - requests: - memory: "32Mi" - cpu: "25m" - limits: - memory: "64Mi" - cpu: "50m" - containers: - - name: redis - image: redis - ports: - - name: redis - containerPort: 6379 - resources: - requests: - memory: "64Mi" - cpu: "50m" - limits: - memory: "128Mi" - cpu: "100m" - - - name: create-deployment-unready - inputs: - parameters: - - name: namespace - resource: - action: apply - manifest: | - apiVersion: apps/v1 - kind: Deployment - metadata: - name: redis-unready - namespace: {{inputs.parameters.namespace}} - spec: - replicas: 1 - selector: - matchLabels: - app: redis - template: - metadata: - labels: - app: redis - annotations: - ad.datadoghq.com/tolerate-unready: "true" - spec: - containers: - - name: redis-unready - image: redis - ports: - - name: redis - containerPort: 6379 - resources: - requests: - memory: "64Mi" - cpu: "50m" - limits: - memory: "128Mi" - cpu: "100m" - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 1 - periodSeconds: 1 - - - name: delete-service - inputs: - parameters: - - name: namespace - resource: - action: delete - manifest: | - apiVersion: v1 - kind: Service - metadata: - name: redis - namespace: {{inputs.parameters.namespace}} - - - name: delete-deployment - inputs: - parameters: - - name: namespace - resource: - action: delete - manifest: | - apiVersion: apps/v1 - kind: Deployment - metadata: - name: redis - namespace: {{inputs.parameters.namespace}} - - - name: delete-deployment-unready - inputs: - parameters: - - name: namespace - resource: - action: delete - manifest: | - apiVersion: apps/v1 - kind: Deployment - metadata: - name: redis-unready - namespace: {{inputs.parameters.namespace}} - - - name: create - inputs: - parameters: - - name: namespace - steps: - - - name: service - template: create-service - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: deployment - template: create-deployment - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: deployment-unready - template: create-deployment-unready - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - - name: delete - inputs: - parameters: - - name: namespace - steps: - - - name: service - template: delete-service - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: deployment - template: delete-deployment - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: deployment-unready - template: delete-deployment-unready - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - - name: find-kube-state-metrics - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: mongo:4.4.1 - command: [mongo, "fake-datadog.{{inputs.parameters.namespace}}.svc.cluster.local/datadog"] - source: | - // This step is intended to test end-to-end scraping of prometheus metrics - // by asserting the value of a few simple metrics collected from the - // kubernetes_state integration. - - while (1) { - var nb = db.series.find({ - metric: "kubernetes_state.deployment.replicas_available", - tags: { $all: ["kube_namespace:{{inputs.parameters.namespace}}", "kube_deployment:redis"] }, - "points.0.1": { $eq: 1 } }).count(); - print("find: " + nb) - if (nb != 0) { - break; - } - sleep(2000); - } - - - name: find-metrics-redis - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: mongo:4.4.1 - command: [mongo, "fake-datadog.{{inputs.parameters.namespace}}.svc.cluster.local/datadog"] - source: | - while (1) { - var nb = db.series.find({ - metric: {$regex: "redis*"} - }).count(); - - print("find: " + nb) - if (nb != 0) { - break; - } - sleep(2000); - } - - - name: find-metrics-redis-unready - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: mongo:4.4.1 - command: [mongo, "fake-datadog.{{inputs.parameters.namespace}}.svc.cluster.local/datadog"] - source: | - while (1) { - var nb = db.series.find({ - metric: {$regex: "redis*"}, - tags: {$all: ["kube_deployment:redis-unready", "kube_container_name:redis-unready"]} - }).count(); - - print("find: " + nb) - if (nb != 0) { - break; - } - sleep(2000); - } - - - name: find-metrics-redis-tagged - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: mongo:4.4.1 - command: [mongo, "fake-datadog.{{inputs.parameters.namespace}}.svc.cluster.local/datadog"] - source: | - while (1) { - var nb = db.series.find({ - metric: {$regex: "redis*"}, - tags: "kube_service:redis" - }).count(); - print("find: " + nb) - if (nb != 0) { - break; - } - sleep(2000); - } - - - name: test - inputs: - parameters: - - name: namespace - steps: - - - name: find-kube-state-metrics - template: find-kube-state-metrics - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: find-metrics-redis - template: find-metrics-redis - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: find-metrics-redis-unready - template: find-metrics-redis-unready - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - name: find-metrics-redis-tagged - template: find-metrics-redis-tagged - arguments: - parameters: - - name: namespace - value: "{{inputs.parameters.namespace}}" - - - name: no-more-metrics - inputs: - parameters: - - name: namespace - activeDeadlineSeconds: 300 - script: - image: mongo:4.4.1 - command: [mongo, "fake-datadog.{{inputs.parameters.namespace}}.svc.cluster.local/datadog"] - source: | - var prevNb = -1; - while (1) { - var nb = db.series.find({ - metric: {$regex: "redis*"} - }).count(); - - print("prev-find: " + prevNb) - print("find: " + nb) - if (nb == prevNb) { - break; - } - prevNb = nb; - sleep(30000); - } - var prevNb = -1 - while (1) { - var nb = db.check_run.find({check: "datadog.agent.check_status", - tags: "check:redisdb", - status: {$ne: 0}}).count(); - - print("prev-find: " + prevNb) - print("find: " + nb) - if (nb == prevNb) { - break; - } - prevNb = nb; - sleep(30000); - } diff --git a/test/e2e/containers/dsd_sender/Dockerfile b/test/e2e/containers/dsd_sender/Dockerfile deleted file mode 100644 index 1b6a5ae33c311..0000000000000 --- a/test/e2e/containers/dsd_sender/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM datadog/docker-library:python_2_7-alpine3_6 - -RUN pip install datadog - -COPY sender.py /sender.py - -CMD [ "python", "/sender.py" ] diff --git a/test/e2e/containers/dsd_sender/Makefile b/test/e2e/containers/dsd_sender/Makefile deleted file mode 100644 index bfdc5e51e0272..0000000000000 --- a/test/e2e/containers/dsd_sender/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -TAG?=latest - -default: build push - -build: - docker build --force-rm -t datadog/docker-library:e2e-dsd-sender_$(TAG) . - -push: - docker push datadog/docker-library:e2e-dsd-sender_$(TAG) diff --git a/test/e2e/containers/dsd_sender/sender.py b/test/e2e/containers/dsd_sender/sender.py deleted file mode 100644 index a589f38a6fa7b..0000000000000 --- a/test/e2e/containers/dsd_sender/sender.py +++ /dev/null @@ -1,23 +0,0 @@ -import time - -import datadog - -client = datadog.dogstatsd.base.DogStatsd(socket_path="/var/run/dogstatsd/dsd.socket") - -while True: - # Nominal case, dsd will inject its hostname - client.gauge('dsd.hostname.e2e', 1, tags=["case:nominal"]) - client.service_check('dsd.hostname.e2e', 0, tags=["case:nominal"]) - client.event('dsd.hostname.e2e', 'text', tags=["case:nominal"]) - - # Force the hostname value - client.gauge('dsd.hostname.e2e', 1, tags=["case:forced", "host:forced"]) - client.service_check('dsd.hostname.e2e', 0, tags=["case:forced"], hostname="forced") - client.event('dsd.hostname.e2e', 'text', tags=["case:forced"], hostname="forced") - - # Force an empty hostname - client.gauge('dsd.hostname.e2e', 1, tags=["case:empty", "host:"]) - client.service_check('dsd.hostname.e2e', 0, tags=["case:empty", "host:"]) - client.event('dsd.hostname.e2e', 'text', tags=["case:empty", "host:"]) - - time.sleep(10) diff --git a/test/e2e/containers/fake_datadog/Dockerfile b/test/e2e/containers/fake_datadog/Dockerfile deleted file mode 100644 index 451b008e217c8..0000000000000 --- a/test/e2e/containers/fake_datadog/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.9-alpine - -COPY app /opt/fake_datadog - -RUN apk update && \ - apk add python3-dev gcc g++ musl-dev libstdc++ && \ - pip install -r /opt/fake_datadog/requirements.txt && \ - apk del python3-dev gcc g++ musl-dev && \ - rm -rf /var/cache/apk/* - -VOLUME /opt/fake_datadog/recorded - -ENV prometheus_multiproc_dir "/var/lib/prometheus" - -CMD ["gunicorn", "--bind", "0.0.0.0:80", "--pythonpath", "/opt/fake_datadog", "api:app"] diff --git a/test/e2e/containers/fake_datadog/Makefile b/test/e2e/containers/fake_datadog/Makefile deleted file mode 100644 index 27bcd71329f18..0000000000000 --- a/test/e2e/containers/fake_datadog/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -TAG?=$(shell date '+%Y%m%d') - -.PHONY: venv pip build default push multiarch - -default: pip - -venv: - virtualenv venv -p python3 - -pip: venv - venv/bin/pip install -r app/requirements.txt - -build: - docker build --force-rm -t datadog/fake-datadog:$(TAG) . - -multiarch: - docker buildx build --platform linux/amd64,linux/arm64 -t datadog/fake-datadog:$(TAG) . --push - -push: - docker push datadog/fake-datadog:$(TAG) diff --git a/test/e2e/containers/fake_datadog/README.md b/test/e2e/containers/fake_datadog/README.md deleted file mode 100644 index efaf81bc96624..0000000000000 --- a/test/e2e/containers/fake_datadog/README.md +++ /dev/null @@ -1,240 +0,0 @@ -# fake_datadog - - -Expose the needed API to make the agent submit payloads. - - -#### API - -Prefer using mongo. - -Get all series: -```bash -curl ${SERVICE_IP}/records/series | jq . -``` - -Get all check_run: -```bash -curl ${SERVICE_IP}/records/check_run | jq . -``` - -Get all intake: -```bash -curl ${SERVICE_IP}/records/intake | jq . -``` - -#### MongoDB - -Explore: -```bash -docker run --rm -it --net=host mongo mongo ${SERVICE_IP}/datadog -``` -```bash -apt-get install -yqq mongodb-clients && mongo ${SERVICE_IP}/datadog -``` -```bash -> show collections -check_run -intake -series - -``` - -#### Find - -Find a metric: -```text -> db.series.findOne() - -{ - "_id" : ObjectId("5ab3e567cd9a72000912abad"), - "metric" : "datadog.agent.running", - "points" : [ - [ - 1521739111, - 1 - ] - ], - "tags" : null, - "host" : "haf", - "type" : "gauge", - "interval" : 0, - "source_type_name" : "System" -} -``` - -Find a metric by metric name: -```text -db.series.findOne({metric: "kubernetes.network.tx_errors"}) - -{ - "_id" : ObjectId("5ab4cca8c914b50008c10615"), - "metric" : "kubernetes.network.tx_errors", - "points" : [ - [ - 1521798304, - 0 - ] - ], - "tags" : [ - "kube_deployment:workflow-controller", - "kube_namespace:kube-system", - "kube_replica_set:workflow-controller-58bbf49865", - "pod_name:workflow-controller-58bbf49865-55xdz" - ], - "host" : "v1704", - "type" : "gauge", - "interval" : 0, - "source_type_name" : "System" -} -``` - -Advanced find: -```js -db.series.find({ - metric: "kubernetes.cpu.usage.total", - tags: { $all: ["kube_namespace:kube-system", "pod_name:kube-controller-manager"] } -}, {_id: 0}) // .count() -``` - -#### Aggregation pipeline - -Aggregate all tags for a metric: -```js -db.series.aggregate([ - { $match: { metric: "kubernetes.cpu.usage.total"} }, - { $project: {tags: 1} }, - { $unwind: "$tags" }, - { $group: {_id: "allTags", tags: {$addToSet: "$tags" } } } -]) -``` - -Aggregate all tags for a metric regex: -```js -db.series.aggregate([ - { $match: { metric: {$regex: "kubernetes*"} } }, - { $project: {tags: 1} }, - { $unwind: "$tags" }, - { $group: {_id: "allTags", tags: {$addToSet: "$tags" } } } -]) -``` - -Aggregate all tags for each metric matched by a regex: -```js -db.series.aggregate([ - { $match: { metric: {$regex: "kubernetes*"} } }, - { $project: { metric: 1, tags: 1 } }, - { $unwind: "$tags" }, - { $group: {_id: "$metric", tags: {$addToSet: "$tags" } } } -]) -``` - -Aggregate all metrics from a tag: -```js -db.series.aggregate([ - { $match: { tags: "kube_deployment:fake-app-datadog"} }, - { $group: { _id: "kube_deployment:fake-app-datadog", metrics: { $addToSet: "$metric" } } } -]) -``` - -Aggregate all metrics from tags ($or || $and): -```js -db.series.aggregate([ - { $match: { $or: [ - {tags: "kube_deployment:fake-app-datadog"}, - {tags: "kube_service:fake-app-datadog"} - ] } }, - { $group: { _id: "metricsToTags", metrics: { $addToSet: "$metric" } } } -]) -``` - -Aggregate a metric and a tag as timeseries: -```js -db.series.aggregate([ - { $match: { tags: "kube_deployment:dd", metric: "kubernetes.cpu.usage.total"} }, - { $unwind: "$points" }, - { $project: { - _id: { $arrayElemAt: [ "$points", 0 ] }, - value: { $arrayElemAt: [ "$points", 1 ] }, - tags: "$tags" - } - }, - { $sort: { _id: 1 } } -]) -``` - -Count tag occurrences on a given metric: -```js -db.series.aggregate([ - { $match: { metric: "kubernetes.filesystem.usage", tags: { $all: ["pod_name:fake-app-datadog-7cfb79db4d-dd4jr"] } } }, - { $project: {tags: 1} }, - { $unwind: "$tags" }, - { $group: {_id: "$tags", count: { $sum: 1 } } }, - { $sort: {count: -1} } -]) -``` - -#### Use standalone - -This tool can be used as a debug proxy to inspect agent payloads. Here is how to do it for Kubernetes. - -##### K8S -- run the following from within this folder: - -```console -docker build -t fake-datadog:latest . -docker tag fake-datadog:latest -docker push -# replace in fake-datadog.yaml before running the next command -kubectl apply -f fake-datadog.yaml -``` - -- edit your Datadog Agent Daemonset to use the service deployed above as the Datadog API. Be aware that each agent has its own intake - configuring `DD_DD_URL` doesn't cover the logs agent for example. - -```yaml -... - env: - ... - - name: DD_DD_URL - # if you deployed the service & deployment in a separate namespace, add `..svc.cluster.local - value: "http://fake-datadog" -``` - -##### Docker - -1. Create a `agent-docker-compose-extra.yaml` file to override url and V2 series environment variables - -```yaml -services: - agent: # use your agent service name here - environment: - DD_DD_URL: "http://fake-datadog" - DD_USE_V2_API_SERIES: false -``` - -- `agent` is the docker service name used for Datadog Agent. Rename it if you are using another service id. -- `DD_DD_URL` overrides the URL for metric submission -- `DD_USE_V2_API_SERIES` force using v1 APIs - -2. Run `docker compose up` passing datadog agent compose, agent extra compose and fake datadog compose - -```bash -docker compose up -f "${PATH_TO_AGENT_COMPOSE}.yaml" -f "fake-datadog.yaml" -f "agent-docker-compose-extra.yaml" -``` - -3. Query `datadog` on `mongo` service, reachable from host at `localhost:27017` and from another container at `mongo:27017` - -##### VM - -1. Create `fake-datadog` compose - -```bash -docker compose up -f "fake-datadog.yaml" -``` - -2. Configure the agent to send requests to `fake-datadog` using `V1` endpoint passing following environment variables - -```txt -DD_DD_URL="http://fake-datadog" -DD_USE_V2_API_SERIES=false -``` diff --git a/test/e2e/containers/fake_datadog/app/__init__.py b/test/e2e/containers/fake_datadog/app/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/test/e2e/containers/fake_datadog/app/api.py b/test/e2e/containers/fake_datadog/app/api.py deleted file mode 100644 index 37445ac6d0ae1..0000000000000 --- a/test/e2e/containers/fake_datadog/app/api.py +++ /dev/null @@ -1,334 +0,0 @@ -import json -import logging -import os -import sys -import zlib -from os import path - -import monitoring -import pymongo -from flask import Flask, Response, jsonify, request - -app = application = Flask("datadoghq") -monitoring.monitor_flask(app) -handler = logging.StreamHandler(sys.stderr) -app.logger.addHandler(handler) -app.logger.setLevel("INFO") - -record_dir = path.join(path.dirname(path.abspath(__file__)), "recorded") - - -def get_collection(name: str): - c = pymongo.MongoClient("127.0.0.1", 27017, connectTimeoutMS=5000) - db = c.get_database("datadog") - return db.get_collection(name) - - -payload_names = [ - "check_run", - "series", - "intake", - "logs", -] - - -def reset_records(): - for elt in payload_names: - to_remove = path.join(record_dir, elt) - if path.isfile(to_remove): - app.logger.warning("rm %s", to_remove) - os.remove(to_remove) - - try: - get_collection(elt).drop() - - except Exception as e: - app.logger.error(e) - - -def record_and_loads(filename: str, content_type: str, content_encoding: str, content: str): - """ - :param filename: - :param content_type: - :param content_encoding: - :param content: - :return: list or dict - """ - if content_type != "application/json": - app.logger.error("Unsupported content-type: %s", content_type) - raise TypeError(content_type) - - if content_encoding == "deflate": - content = zlib.decompress(content) - - content = content.decode() - content = f"{content}\n" if content[-1] != "\n" else content - with open(path.join(record_dir, filename), "a") as f: - f.write(content) - - return json.loads(content) - - -def patch_data(data, patch_key, patch_leaf): - if isinstance(data, dict): - return {patch_key(k): patch_data(v, patch_key, patch_leaf) for k, v in iter(data.items())} - elif isinstance(data, list): - return [patch_data(i, patch_key, patch_leaf) for i in data] - else: - return patch_leaf(data) - - -def fix_data(data): - return patch_data( - data, - # Whereas dot (.) and dollar ($) are valid characters inside a JSON dict key, - # they are not allowed as keys in a MongoDB BSON object. - # The official MongoDB documentation suggests to replace them with their - # unicode full width equivalent: - # https://docs.mongodb.com/v2.6/faq/developers/#dollar-sign-operator-escaping - patch_key=lambda x: x.translate(str.maketrans('.$', '\uff0e\uff04')), - # Values that cannot fit in a 64 bits integer must be represented as a float. - patch_leaf=lambda x: float(x) if isinstance(x, int) and x > 2**63 - 1 else x, - ) - - -def insert_series(data: dict): - coll = get_collection("series") - coll.insert_many(data["series"]) - - -def insert_intake(data: dict): - coll = get_collection("intake") - coll.insert_one(data) - - -def insert_check_run(data: list): - coll = get_collection("check_run") - coll.insert_many(data) - - -def insert_logs(data: list): - coll = get_collection("logs") - coll.insert_many(data) - - -def get_series_from_query(q: dict): - app.logger.info("Query is %s", q["query"]) - query = q["query"].replace("avg:", "") - first_open_brace, first_close_brace = query.index("{"), query.index("}") - - metric_name = query[:first_open_brace] - from_ts, to_ts = int(q["from"]), int(q["to"]) - - # tags - all_tags = query[first_open_brace + 1 : first_close_brace] - all_tags = all_tags.split(",") if all_tags else [] - - # group by - # TODO - last_open_brace, last_close_brace = query.rindex("{"), query.rindex("}") - group_by = query[last_open_brace + 1 : last_close_brace].split(",") # noqa: F841 - - match_conditions = [ - {"metric": metric_name}, - {"points.0.0": {"$gt": from_ts}}, - {"points.0.0": {"$lt": to_ts}}, - ] - if all_tags: - match_conditions.append({'tags': {"$all": all_tags}}) - - c = get_collection("series") - aggregate = [ - {"$match": {"$and": match_conditions}}, - {"$unwind": "$points"}, - {"$group": {"_id": "$metric", "points": {"$push": "$points"}}}, - {"$sort": {"points.0": 1}}, - ] - app.logger.info("Mongodb aggregate is %s", aggregate) - cur = c.aggregate(aggregate) - points_list = [] - for elt in cur: - for p in elt["points"]: - p[0] *= 1000 - points_list.append(p) - - result = { - "status": "ok", - "res_type": "time_series", - "series": [ - { - "metric": metric_name, - "attributes": {}, - "display_name": metric_name, - "unit": None, - "pointlist": points_list, - "end": points_list[-1][0] if points_list else 0.0, - "interval": 600, - "start": points_list[0][0] if points_list else 0.0, - "length": len(points_list), - "aggr": None, - "scope": "host:vagrant-ubuntu-trusty-64", # TODO - "expression": query, - } - ], - "from_date": from_ts, - "group_by": ["host"], - "to_date": to_ts, - "query": q["query"], - "message": "", - } - return result - - -@app.route("/api/v1/validate", methods=["GET"]) -def validate(): - return Response(status=200) - - -@app.route("/api/v1/query", methods=["GET"]) -def metrics_query(): - """ - Honor a query like documented here: - https://docs.datadoghq.com/api/?lang=bash#query-time-series-points - :return: - """ - if "query" not in request.args or "from" not in request.args or "to" not in request.args: - return Response(status=400) - - return jsonify(get_series_from_query(request.args)) - - -@app.route("/api/v1/series", methods=["POST"]) -def series(): - data = record_and_loads( - filename="series", - content_type=request.content_type, - content_encoding=request.content_encoding, - content=request.data, - ) - data = fix_data(data) - insert_series(data) - return Response(status=200) - - -@app.route("/api/v1/check_run", methods=["POST"]) -def check_run(): - data = record_and_loads( - filename="check_run", - content_type=request.content_type, - content_encoding=request.content_encoding, - content=request.data, - ) - data = fix_data(data) - insert_check_run(data) - return Response(status=200) - - -@app.route("/intake/", methods=["POST"]) -def intake(): - data = record_and_loads( - filename="intake", - content_type=request.content_type, - content_encoding=request.content_encoding, - content=request.data, - ) - data = fix_data(data) - insert_intake(data) - return Response(status=200) - - -@app.route("/v1/input/", methods=["POST"]) -def logs(): - data = record_and_loads( - filename="logs", - content_type=request.content_type, - content_encoding=request.content_encoding, - content=request.data, - ) - data = fix_data(data) - insert_logs(data) - return Response(status=200) - - -@app.route("/api/v2/orch", methods=["POST"]) -def orchestrator(): - # TODO - return Response(status=200) - - -@app.before_request -def logging(): - # use only if you need to check headers - # mind where the logs of this container go since headers contain an API key - # app.logger.info( - # "path: %s, method: %s, content-type: %s, content-encoding: %s, content-length: %s, headers: %s", - # request.path, request.method, request.content_type, request.content_encoding, request.content_length, request.headers) - app.logger.info( - "path: %s, method: %s, content-type: %s, content-encoding: %s, content-length: %s", - request.path, - request.method, - request.content_type, - request.content_encoding, - request.content_length, - ) - - -def stat_records(): - j = {} - for elt in payload_names: - try: - p = path.join(record_dir, elt) - st = os.stat(p) - lines = 0 - with open(p) as f: - for _ in f: - lines += 1 - j[elt] = {"size": st.st_size, "lines": lines} - - except FileNotFoundError: - j[elt] = {"size": -1, "lines": -1} - return j - - -@app.route("/_/records") -def available_records(): - return jsonify(stat_records()) - - -@app.route("/_/records/") -def get_records(name): - if name not in payload_names: - return Response(status=404) - - if path.isfile(path.join(record_dir, name)) is False: - return Response(status=503) - - payloads = [] - with open(path.join(record_dir, name)) as f: - for line in f: - payloads.append(json.loads(line)) - return json.dumps(payloads), 200 - - -@application.route('/', methods=['GET']) -def api_mapper(): - rules = [k.rule for k in application.url_map.iter_rules()] - rules = list(set(rules)) - rules.sort() - return jsonify(rules) - - -@application.route('/_/reset', methods=['POST']) -def reset(): - reset_records() - return jsonify(stat_records()) - - -@application.errorhandler(404) -def not_found(_): - app.logger.warning("404 %s %s", request.path, request.method) - return Response("404", status=404, mimetype="text/plain") - - -if __name__ == '__main__': - app.run(host="0.0.0.0", debug=True, port=5000) diff --git a/test/e2e/containers/fake_datadog/app/monitoring.py b/test/e2e/containers/fake_datadog/app/monitoring.py deleted file mode 100644 index 15ae0a1a9e3c8..0000000000000 --- a/test/e2e/containers/fake_datadog/app/monitoring.py +++ /dev/null @@ -1,74 +0,0 @@ -import os -import sys -import time - -from flask import Flask, Response, g, request -from prometheus_client import CONTENT_TYPE_LATEST, CollectorRegistry, Counter, Histogram, generate_latest, multiprocess - - -def extract_exception_name(exc_info=None): - """ - Function to get the exception name and module - :param exc_info: - :return: - """ - if not exc_info: - exc_info = sys.exc_info() - return f'{exc_info[0].__module__}.{exc_info[0].__name__}' - - -def monitor_flask(app: Flask): - """ - Add components to monitor each route with prometheus - The monitoring is available at /metrics - :param app: Flask application - :return: - """ - prometheus_state_dir = os.getenv('prometheus_multiproc_dir', "") - if "gunicorn" not in os.getenv("SERVER_SOFTWARE", "") and prometheus_state_dir == "": - return - - if os.path.isdir(prometheus_state_dir) is False: - os.mkdir(prometheus_state_dir) - - metrics = CollectorRegistry() - - def collect(): - registry = CollectorRegistry() - multiprocess.MultiProcessCollector(registry) - data = generate_latest(registry) - return Response(data, mimetype=CONTENT_TYPE_LATEST) - - app.add_url_rule('/metrics', 'metrics', collect) - - additional_kwargs = {'registry': metrics} - request_latency = Histogram( - 'requests_duration_seconds', 'Backend API request latency', ['method', 'path'], **additional_kwargs - ) - status_count = Counter( - 'responses_total', 'Backend API response count', ['method', 'path', 'status_code'], **additional_kwargs - ) - exception_latency = Histogram( - 'exceptions_duration_seconds', - 'Backend API top-level exception latency', - ['method', 'path', 'type'], - **additional_kwargs, - ) - - @app.before_request - def start_measure(): - g._start_time = time.time() - - @app.after_request - def count_status(response: Response): - status_count.labels(request.method, request.url_rule, response.status_code).inc() - request_latency.labels(request.method, request.url_rule).observe(time.time() - g._start_time) - return response - - # Override log_exception to increment the exception counter - def log_exception(exc_info): - class_name = extract_exception_name(exc_info) - exception_latency.labels(request.method, request.url_rule, class_name).observe(time.time() - g._start_time) - app.logger.error('Exception on %s [%s]', request.path, request.method, exc_info=exc_info) - - app.log_exception = log_exception diff --git a/test/e2e/containers/fake_datadog/app/requirements.txt b/test/e2e/containers/fake_datadog/app/requirements.txt deleted file mode 100644 index 146792ede7f30..0000000000000 --- a/test/e2e/containers/fake_datadog/app/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -Flask==2.1.2 -gunicorn==20.1.0 -pymongo==4.1.1 -prometheus-client==0.14.1 diff --git a/test/e2e/containers/fake_datadog/docker-compose.yaml b/test/e2e/containers/fake_datadog/docker-compose.yaml deleted file mode 100644 index eb4ff70532c8d..0000000000000 --- a/test/e2e/containers/fake_datadog/docker-compose.yaml +++ /dev/null @@ -1,13 +0,0 @@ -version: "3.9" -services: - fake-datadog: - image: "datadog/fake-datadog:20220621" - ports: - - "8080:80" - - "27017:27017" - container_name: fake-datadog - mongo: - image: "mongo:5.0" - container_name: mongo - network_mode: "service:fake-datadog" - diff --git a/test/e2e/containers/fake_datadog/fake-datadog.yaml b/test/e2e/containers/fake_datadog/fake-datadog.yaml deleted file mode 100644 index ceeceda9b3b60..0000000000000 --- a/test/e2e/containers/fake_datadog/fake-datadog.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: fake-datadog -spec: - ports: - - port: 80 - protocol: TCP - targetPort: 80 - name: api - - port: 27017 - protocol: TCP - targetPort: 27017 - name: mongo - selector: - app: fake-datadog - type: ClusterIP - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: fake-datadog -spec: - replicas: 1 - selector: - matchLabels: - app: fake-datadog - strategy: - type: RollingUpdate - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - template: - metadata: - labels: - app: fake-datadog - spec: - containers: - - name: api - image: - imagePullPolicy: Always - - name: mongo - image: mongo:3.6.3 - diff --git a/test/e2e/containers/otlp_sender/Dockerfile b/test/e2e/containers/otlp_sender/Dockerfile deleted file mode 100644 index 5613d30c6c642..0000000000000 --- a/test/e2e/containers/otlp_sender/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM alpine:latest as prep -RUN apk --update add ca-certificates - -FROM scratch -ARG USER_UID=10001 -USER ${USER_UID} -COPY --from=prep /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY otlpsender / -EXPOSE 4317 55680 55679 -ENTRYPOINT ["/otlpsender"] -CMD ["--config", "/etc/otel/config.yaml"] diff --git a/test/e2e/containers/otlp_sender/Makefile b/test/e2e/containers/otlp_sender/Makefile deleted file mode 100644 index 880e85dfca46c..0000000000000 --- a/test/e2e/containers/otlp_sender/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TAG?=latest - -default: push - -otlpsender: - GOOS=linux GOARCH=amd64 go build -o $@ ./cmd/sender - -docker-build: otlpsender - docker build --force-rm -t datadog/docker-library:e2e-otlp-sender_$(TAG) . - -push: docker-build - docker push datadog/docker-library:e2e-otlp-sender_$(TAG) diff --git a/test/e2e/containers/otlp_sender/cmd/sender/main.go b/test/e2e/containers/otlp_sender/cmd/sender/main.go deleted file mode 100644 index b30813cc7f789..0000000000000 --- a/test/e2e/containers/otlp_sender/cmd/sender/main.go +++ /dev/null @@ -1,79 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2021-present Datadog, Inc. - -// Program otlp_sender sends telemetry data defined in a given file -package main - -import ( - "log" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/exporter" - "go.opentelemetry.io/collector/exporter/debugexporter" - "go.opentelemetry.io/collector/exporter/otlpexporter" - "go.opentelemetry.io/collector/exporter/otlphttpexporter" - "go.opentelemetry.io/collector/extension" - "go.opentelemetry.io/collector/otelcol" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/receiver" - "go.uber.org/multierr" - - "github.com/DataDog/datadog-agent/tests/e2e/containers/otlp_sender/internal/filereceiver" -) - -func components() ( - otelcol.Factories, - error, -) { - var errs error - - extensions, err := extension.MakeFactoryMap() - errs = multierr.Append(errs, err) - - receivers, err := receiver.MakeFactoryMap( - filereceiver.NewFactory(), - ) - errs = multierr.Append(errs, err) - - exporters, err := exporter.MakeFactoryMap( - otlpexporter.NewFactory(), - otlphttpexporter.NewFactory(), - debugexporter.NewFactory(), - ) - errs = multierr.Append(errs, err) - - processors, err := processor.MakeFactoryMap() - errs = multierr.Append(errs, err) - - factories := otelcol.Factories{ - Extensions: extensions, - Receivers: receivers, - Processors: processors, - Exporters: exporters, - } - - return factories, errs -} - -func main() { - factories, err := components() - if err != nil { - log.Fatalf("failed to build components: %v", err) - } - - cmd := otelcol.NewCommand(otelcol.CollectorSettings{ - BuildInfo: component.BuildInfo{ - Command: "otlpsender", - Description: "OpenTelemetry test sender", - Version: "latest", - }, - Factories: func() (otelcol.Factories, error) { - return factories, nil - }, - }) - if err := cmd.Execute(); err != nil { - log.Fatalf("collector server run finished with error: %v", err) - } -} diff --git a/test/e2e/containers/otlp_sender/go.mod b/test/e2e/containers/otlp_sender/go.mod deleted file mode 100644 index 3ae057624be2d..0000000000000 --- a/test/e2e/containers/otlp_sender/go.mod +++ /dev/null @@ -1,109 +0,0 @@ -module github.com/DataDog/datadog-agent/tests/e2e/containers/otlp_sender - -go 1.22.0 - -require ( - go.opentelemetry.io/collector/component v0.104.0 - go.opentelemetry.io/collector/consumer v0.104.0 - go.opentelemetry.io/collector/exporter v0.104.0 - go.opentelemetry.io/collector/exporter/debugexporter v0.104.0 - go.opentelemetry.io/collector/exporter/otlpexporter v0.104.0 - go.opentelemetry.io/collector/exporter/otlphttpexporter v0.104.0 - go.opentelemetry.io/collector/extension v0.104.0 - go.opentelemetry.io/collector/otelcol v0.104.0 - go.opentelemetry.io/collector/pdata v1.11.0 - go.opentelemetry.io/collector/processor v0.104.0 - go.opentelemetry.io/collector/receiver v0.104.0 - go.uber.org/multierr v1.11.0 - go.uber.org/zap v1.27.0 -) - -require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.9 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mostynb/go-grpc-compression v1.2.3 // indirect - github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_golang v1.19.1 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.54.0 // indirect - github.com/prometheus/procfs v0.15.0 // indirect - github.com/rs/cors v1.10.1 // indirect - github.com/shirou/gopsutil/v4 v4.24.5 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/spf13/cobra v1.8.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/tklauser/go-sysconf v0.3.12 // indirect - github.com/tklauser/numcpus v0.6.1 // indirect - github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/collector v0.104.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.104.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.11.0 // indirect - go.opentelemetry.io/collector/config/configgrpc v0.104.0 // indirect - go.opentelemetry.io/collector/config/confighttp v0.104.0 // indirect - go.opentelemetry.io/collector/config/confignet v0.104.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.11.0 // indirect - go.opentelemetry.io/collector/config/configretry v1.11.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.104.0 // indirect - go.opentelemetry.io/collector/config/configtls v0.104.0 // indirect - go.opentelemetry.io/collector/config/internal v0.104.0 // indirect - go.opentelemetry.io/collector/confmap v0.104.0 // indirect - go.opentelemetry.io/collector/connector v0.104.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.104.0 // indirect - go.opentelemetry.io/collector/featuregate v1.11.0 // indirect - go.opentelemetry.io/collector/semconv v0.104.0 // indirect - go.opentelemetry.io/collector/service v0.104.0 // indirect - go.opentelemetry.io/contrib/config v0.7.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect - go.opentelemetry.io/contrib/propagators/b3 v1.27.0 // indirect - go.opentelemetry.io/otel v1.27.0 // indirect - go.opentelemetry.io/otel/bridge/opencensus v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.27.0 // indirect - go.opentelemetry.io/otel/sdk v1.27.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect - go.opentelemetry.io/otel/trace v1.27.0 // indirect - go.opentelemetry.io/proto/otlp v1.2.0 // indirect - golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect - gonum.org/v1/gonum v0.15.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.2 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/test/e2e/containers/otlp_sender/go.sum b/test/e2e/containers/otlp_sender/go.sum deleted file mode 100644 index 5f88f0d5eafab..0000000000000 --- a/test/e2e/containers/otlp_sender/go.sum +++ /dev/null @@ -1,344 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= -github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= -github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mLPqKctH7Uo//I= -github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= -github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= -github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= -github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= -github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shirou/gopsutil/v4 v4.24.5 h1:gGsArG5K6vmsh5hcFOHaPm87UD003CaDMkAOweSQjhM= -github.com/shirou/gopsutil/v4 v4.24.5/go.mod h1:aoebb2vxetJ/yIDZISmduFvVNPHqXQ9SEJwRXxkf0RA= -github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= -github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= -github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= -github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= -github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= -github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= -github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= -github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= -github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.104.0 h1:R3zjM4O3K3+ttzsjPV75P80xalxRbwYTURlK0ys7uyo= -go.opentelemetry.io/collector v0.104.0/go.mod h1:Tm6F3na9ajnOm6I5goU9dURKxq1fSBK1yA94nvUix3k= -go.opentelemetry.io/collector/component v0.104.0 h1:jqu/X9rnv8ha0RNZ1a9+x7OU49KwSMsPbOuIEykHuQE= -go.opentelemetry.io/collector/component v0.104.0/go.mod h1:1C7C0hMVSbXyY1ycCmaMUAR9fVwpgyiNQqxXtEWhVpw= -go.opentelemetry.io/collector/config/configauth v0.104.0 h1:ULtjugImijpKuLgGVt0E0HwiZT7+uDUEtMquh1ODB24= -go.opentelemetry.io/collector/config/configauth v0.104.0/go.mod h1:Til+nLLrQwwhgmfcGTX4ZRcNuMhdaWhBW1jH9DLTabQ= -go.opentelemetry.io/collector/config/configcompression v1.11.0 h1:oTwbcLh7mWHSDUIZXkRJVdNAMoBGS39XF68goTMOQq8= -go.opentelemetry.io/collector/config/configcompression v1.11.0/go.mod h1:6+m0GKCv7JKzaumn7u80A2dLNCuYf5wdR87HWreoBO0= -go.opentelemetry.io/collector/config/configgrpc v0.104.0 h1:E3RtqryQPOm/trJmhlJZj6cCqJNKgv9fOEQvSEpzsFM= -go.opentelemetry.io/collector/config/configgrpc v0.104.0/go.mod h1:tu3ifnJ5pv+4rZcaqNWfvVLjNKb8icSPoClN3THN8PU= -go.opentelemetry.io/collector/config/confighttp v0.104.0 h1:KSY0FSHSjuPyrR6iA2g5oFTozYFpYcy0ssJny8gTNTQ= -go.opentelemetry.io/collector/config/confighttp v0.104.0/go.mod h1:YgSXwuMYHANzzv+IBjHXaBMG/4G2mrseIpICHj+LB3U= -go.opentelemetry.io/collector/config/confignet v0.104.0 h1:i7AOTJf4EQox3SEt1YtQFQR+BwXr3v5D9x3Ai9/ovy8= -go.opentelemetry.io/collector/config/confignet v0.104.0/go.mod h1:pfOrCTfSZEB6H2rKtx41/3RN4dKs+X2EKQbw3MGRh0E= -go.opentelemetry.io/collector/config/configopaque v1.11.0 h1:Pt06PXWVmRaiSX63mzwT8Z9SV/hOc6VHNZbfZ10YY4o= -go.opentelemetry.io/collector/config/configopaque v1.11.0/go.mod h1:0xURn2sOy5j4fbaocpEYfM97HPGsiffkkVudSPyTJlM= -go.opentelemetry.io/collector/config/configretry v1.11.0 h1:UdEDD0ThxPU7+n2EiKJxVTvDCGygXu9hTfT6LOQv9DY= -go.opentelemetry.io/collector/config/configretry v1.11.0/go.mod h1:P+RA0IA+QoxnDn4072uyeAk1RIoYiCbxYsjpKX5eFC4= -go.opentelemetry.io/collector/config/configtelemetry v0.104.0 h1:eHv98XIhapZA8MgTiipvi+FDOXoFhCYOwyKReOt+E4E= -go.opentelemetry.io/collector/config/configtelemetry v0.104.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= -go.opentelemetry.io/collector/config/configtls v0.104.0 h1:bMmLz2+r+REpO7cDOR+srOJHfitqTZfSZCffDpKfwWk= -go.opentelemetry.io/collector/config/configtls v0.104.0/go.mod h1:e33o7TWcKfe4ToLFyGISEPGMgp6ezf3yHRGY4gs9nKk= -go.opentelemetry.io/collector/config/internal v0.104.0 h1:h3OkxTfXWWrHRyPEGMpJb4fH+54puSBuzm6GQbuEZ2o= -go.opentelemetry.io/collector/config/internal v0.104.0/go.mod h1:KjH43jsAUFyZPeTOz7GrPORMQCK13wRMCyQpWk99gMo= -go.opentelemetry.io/collector/confmap v0.104.0 h1:d3yuwX+CHpoyCh0iMv3rqb/vwAekjSm4ZDL6UK1nZSA= -go.opentelemetry.io/collector/confmap v0.104.0/go.mod h1:F8Lue+tPPn2oldXcfqI75PPMJoyzgUsKVtM/uHZLA4w= -go.opentelemetry.io/collector/connector v0.104.0 h1:Y82ytwZZ+EruWafEebO0dgWMH+TdkcSONEqZ5bm9JYA= -go.opentelemetry.io/collector/connector v0.104.0/go.mod h1:78SEHel3B3taFnSBg/syW4OV9aU1Ec9KjgbgHf/L8JA= -go.opentelemetry.io/collector/consumer v0.104.0 h1:Z1ZjapFp5mUcbkGEL96ljpqLIUMhRgQQpYKkDRtxy+4= -go.opentelemetry.io/collector/consumer v0.104.0/go.mod h1:60zcIb0W9GW0z9uJCv6NmjpSbCfBOeRUyrtEwqK6Hzo= -go.opentelemetry.io/collector/exporter v0.104.0 h1:C2HmnfBa05IQ2T+p9T7K7gXVxjrBLd+JxEtAWo7JNbg= -go.opentelemetry.io/collector/exporter v0.104.0/go.mod h1:Rx0oB0E4Ccg1JuAnEWwhtrq1ygRBkfx4mco1DpR3WaQ= -go.opentelemetry.io/collector/exporter/debugexporter v0.104.0 h1:1Z63H/xxv6IzMP7GPmI6v/lQAqZwYZCVC0rWYcYOomw= -go.opentelemetry.io/collector/exporter/debugexporter v0.104.0/go.mod h1:NHVzTM0Z/bomgR7SAe3ysx4CZzh2UJ3TXWSCnaOB1Wo= -go.opentelemetry.io/collector/exporter/otlpexporter v0.104.0 h1:EFOdhnc2yGhqou0Tud1HsM7fsgWo/H3tdQhYYytDprQ= -go.opentelemetry.io/collector/exporter/otlpexporter v0.104.0/go.mod h1:fAF7Q3Xh0OkxYWUycdrNNDXkyz3nhHIRKDkez0aQ6zg= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.104.0 h1:JkNCOj7DdyJhcYIaRqtS/X+YtAPRjE4pcruyY6LoM7c= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.104.0/go.mod h1:6rs4Xugs7tIC3IFbAC+fj56zLiVc7osXC5UTjk/Mkw4= -go.opentelemetry.io/collector/extension v0.104.0 h1:bftkgFMKya/QIwK+bOxEAPVs/TvTez+s1mlaiUznJkA= -go.opentelemetry.io/collector/extension v0.104.0/go.mod h1:x7K0KyM1JGrtLbafEbRoVp0VpGBHpyx9hu87bsja6S4= -go.opentelemetry.io/collector/extension/auth v0.104.0 h1:SelhccGCrqLThPlkbv6lbAowHsjgOTAWcAPz085IEC4= -go.opentelemetry.io/collector/extension/auth v0.104.0/go.mod h1:s3/C7LTSfa91QK0JPMTRIvH/gCv+a4DGiiNeTAX9OhI= -go.opentelemetry.io/collector/extension/zpagesextension v0.104.0 h1:rJ9Sw6DR27s6bW7lWBjJhjth5CXpltAHBKIgUFgVwFs= -go.opentelemetry.io/collector/extension/zpagesextension v0.104.0/go.mod h1:85Exj8r237PIvaXL1a/S0KeVNnm3kQNpVXtu0O2Zk5k= -go.opentelemetry.io/collector/featuregate v1.11.0 h1:Z7puIymKoQRm3oNM/NH8reWc2zRPz2PNaJvuokh0lQY= -go.opentelemetry.io/collector/featuregate v1.11.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= -go.opentelemetry.io/collector/otelcol v0.104.0 h1:RnMx7RaSFmX4dq/l3wbXWwcUnFK7RU19AM/0FbMr0Ig= -go.opentelemetry.io/collector/otelcol v0.104.0/go.mod h1:hWFRiHIKT3zbUx6SRevusPRa6mfm+70bPG5CK0glqSU= -go.opentelemetry.io/collector/pdata v1.11.0 h1:rzYyV1zfTQQz1DI9hCiaKyyaczqawN75XO9mdXmR/hE= -go.opentelemetry.io/collector/pdata v1.11.0/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= -go.opentelemetry.io/collector/pdata/pprofile v0.104.0 h1:MYOIHvPlKEJbWLiBKFQWGD0xd2u22xGVLt4jPbdxP4Y= -go.opentelemetry.io/collector/pdata/pprofile v0.104.0/go.mod h1:7WpyHk2wJZRx70CGkBio8klrYTTXASbyIhf+rH4FKnA= -go.opentelemetry.io/collector/pdata/testdata v0.104.0 h1:BKTZ7hIyAX5DMPecrXkVB2e86HwWtJyOlXn/5vSVXNw= -go.opentelemetry.io/collector/pdata/testdata v0.104.0/go.mod h1:3SnYKu8gLfxURJMWS/cFEUFs+jEKS6jvfqKXnOZsdkQ= -go.opentelemetry.io/collector/processor v0.104.0 h1:KSvMDu4DWmK1/k2z2rOzMtTvAa00jnTabtPEK9WOSYI= -go.opentelemetry.io/collector/processor v0.104.0/go.mod h1:qU2/xCCYdvVORkN6aq0H/WUWkvo505VGYg2eOwPvaTg= -go.opentelemetry.io/collector/receiver v0.104.0 h1:URL1ExkYYd+qbndm7CdGvI2mxzsv/pNfmwJ+1QSQ9/o= -go.opentelemetry.io/collector/receiver v0.104.0/go.mod h1:+enTCZQLf6dRRANWvykXEzrlRw2JDppXJtoYWd/Dd54= -go.opentelemetry.io/collector/semconv v0.104.0 h1:dUvajnh+AYJLEW/XOPk0T0BlwltSdi3vrjO7nSOos3k= -go.opentelemetry.io/collector/semconv v0.104.0/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= -go.opentelemetry.io/collector/service v0.104.0 h1:DTpkoX4C6qiA3v3cfB2cHv/cH705o5JI9J3P77SFUrE= -go.opentelemetry.io/collector/service v0.104.0/go.mod h1:eq68zgpqRDYaVp60NeRu973J0rA5vZJkezfw/EzxLXc= -go.opentelemetry.io/contrib/config v0.7.0 h1:b1rK5tGTuhhPirJiMxOcyQfZs76j2VapY6ODn3b2Dbs= -go.opentelemetry.io/contrib/config v0.7.0/go.mod h1:8tdiFd8N5etOi3XzBmAoMxplEzI3TcL8dU5rM5/xcOQ= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= -go.opentelemetry.io/contrib/propagators/b3 v1.27.0 h1:IjgxbomVrV9za6bRi8fWCNXENs0co37SZedQilP2hm0= -go.opentelemetry.io/contrib/propagators/b3 v1.27.0/go.mod h1:Dv9obQz25lCisDvvs4dy28UPh974CxkahRDUPsY7y9E= -go.opentelemetry.io/contrib/zpages v0.52.0 h1:MPgkMy0Cp3O5EdfVXP0ss3ujhEibysTM4eszx7E7d+E= -go.opentelemetry.io/contrib/zpages v0.52.0/go.mod h1:fqG5AFdoYru3A3DnhibVuaaEfQV2WKxE7fYE1jgDRwk= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/bridge/opencensus v1.27.0 h1:ao9aGGHd+G4YfjBpGs6vbkvt5hoC67STlJA9fCnOAcs= -go.opentelemetry.io/otel/bridge/opencensus v1.27.0/go.mod h1:uRvWtAAXzyVOST0WMPX5JHGBaAvBws+2F8PcC5gMnTk= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0 h1:bFgvUr3/O4PHj3VQcFEuYKvRZJX1SJDQ+11JXuSB3/w= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.27.0/go.mod h1:xJntEd2KL6Qdg5lwp97HMLQDVeAhrYxmzFseAMDPQ8I= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0 h1:CIHWikMsN3wO+wq1Tp5VGdVRTcON+DmOJSfDjXypKOc= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.27.0/go.mod h1:TNupZ6cxqyFEpLXAZW7On+mLFL0/g0TE3unIYL91xWc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0 h1:QY7/0NeRPKlzusf40ZE4t1VlMKbqSNT7cJRYzWuja0s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.27.0/go.mod h1:HVkSiDhTM9BoUJU8qE6j2eSWLLXvi1USXjyd2BXT8PY= -go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= -go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 h1:/jlt1Y8gXWiHG9FBx6cJaIC5hYx5Fe64nC8w5Cylt/0= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0/go.mod h1:bmToOGOBZ4hA9ghphIc1PAf66VA8KOtsuy3+ScStG20= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0 h1:/0YaXu3755A/cFbtXp+21lkXgI0QE5avTWA2HjU9/WE= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0/go.mod h1:m7SFxp0/7IxmJPLIY3JhOcU9CoFzDaCPL6xxQIxhA+o= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/sdk/metric v1.27.0 h1:5uGNOlpXi+Hbo/DRoI31BSb1v+OGcpv2NemcCrOL8gI= -go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0SA+769l93J6bsyvqw= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= -go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= -go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= -gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/test/e2e/containers/otlp_sender/internal/filereceiver/factory.go b/test/e2e/containers/otlp_sender/internal/filereceiver/factory.go deleted file mode 100644 index 29864597b910a..0000000000000 --- a/test/e2e/containers/otlp_sender/internal/filereceiver/factory.go +++ /dev/null @@ -1,157 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed -// under the Apache License Version 2.0. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2021-present Datadog, Inc. - -// Package filereceiver implements a receiver that reads OTLP metrics from a given file. -package filereceiver - -import ( - "bufio" - "context" - "errors" - "fmt" - "log" - "os" - "time" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/pdata/pmetric" - collectorreceiver "go.opentelemetry.io/collector/receiver" - - "go.uber.org/zap" -) - -const typeStr = "file" - -// NewFactory creates a new OTLP receiver factory. -func NewFactory() collectorreceiver.Factory { - cfgType, _ := component.NewType(typeStr) - return collectorreceiver.NewFactory( - cfgType, - createDefaultConfig, - collectorreceiver.WithMetrics(createMetricsReceiver, component.StabilityLevelAlpha), - ) -} - -// Config of filereceiver. -type Config struct { - collectorreceiver.Settings `mapstructure:",squash"` - // Path of metrics data. - Path string `mapstructure:"path"` - // LoopConfig is the loop configuration. - Loop LoopConfig `mapstructure:"loop"` -} - -// LoopConfig is the loop configuration. -type LoopConfig struct { - // Enabled states whether the feature is enabled. - Enabled bool `mapstructure:"enabled"` - // Period defines the loop period. - Period time.Duration `mapstructure:"period"` -} - -// Validate configuration of receiver. -func (cfg *Config) Validate() error { - if cfg.Path == "" { - return errors.New("path can't be empty") - } - return nil -} - -func createDefaultConfig() component.Config { - cfgType, _ := component.NewType(typeStr) - return &Config{ - Settings: collectorreceiver.Settings{ - ID: component.NewID(cfgType), - }, - Loop: LoopConfig{Enabled: false, Period: 10 * time.Second}, - } -} - -var _ collectorreceiver.Metrics = (*receiver)(nil) - -type receiver struct { - config *Config - logger *zap.Logger - unmarshaler pmetric.Unmarshaler - nextConsumer consumer.Metrics - stopCh chan struct{} -} - -func (r *receiver) Start(_ context.Context, host component.Host) error { - if r.config.Loop.Enabled { - r.logger.Info("Running in a loop") - go r.unmarshalLoop(host) - } else { - r.logger.Info("Running just once") - go r.unmarshalAndSend(host) - } - return nil -} - -func (r *receiver) unmarshalAndSend(_ component.Host) { - file, err := os.Open(r.config.Path) - if err != nil { - log.Fatal(fmt.Errorf("failed to open %q: %w", r.config.Path, err)) - return - } - - r.logger.Info("Sending metrics batch") - scanner := bufio.NewScanner(file) - for scanner.Scan() { - metrics, err := r.unmarshaler.UnmarshalMetrics(scanner.Bytes()) - if err != nil { - log.Fatal(fmt.Errorf("failed to unmarshal %q: %w", r.config.Path, err)) - return - } - - err = r.nextConsumer.ConsumeMetrics(context.Background(), metrics) - if err != nil { - log.Fatal(fmt.Errorf("failed to send %q: %w", r.config.Path, err)) - return - } - } - - if err := scanner.Err(); err != nil { - log.Fatal(fmt.Errorf("failed to scan %q: %w", r.config.Path, err)) - return - } - - if err := file.Close(); err != nil { - log.Fatal(fmt.Errorf("failed to close %q: %w", r.config.Path, err)) - return - } -} - -func (r *receiver) unmarshalLoop(host component.Host) { - for { - r.unmarshalAndSend(host) - select { - case <-time.After(r.config.Loop.Period): - case <-r.stopCh: - return - } - } -} - -func (r *receiver) Shutdown(context.Context) error { - close(r.stopCh) - return nil -} - -func createMetricsReceiver( - _ context.Context, - set collectorreceiver.Settings, - cfg component.Config, - consumer consumer.Metrics, -) (collectorreceiver.Metrics, error) { - return &receiver{ - config: cfg.(*Config), - logger: set.Logger, - unmarshaler: &pmetric.JSONUnmarshaler{}, - nextConsumer: consumer, - stopCh: make(chan struct{}), - }, nil -} diff --git a/test/e2e/cws-tests/README.md b/test/e2e/cws-tests/README.md deleted file mode 100644 index 5008231122df1..0000000000000 --- a/test/e2e/cws-tests/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# CSPM e2e tests - -## Docker flavors - -To run docker flavoured tests, local only, please run: - -For CSPM: -```sh -DD_API_KEY= \ -DD_APP_KEY= \ -DD_SITE=datadoghq.com \ -DD_AGENT_IMAGE=datadog/agent-dev:master \ -python3 tests/test_e2e_cspm_docker.py -``` - -Please change `DD_AGENT_IMAGE` to a branch specific tag if you need to test a specific branch. diff --git a/test/e2e/cws-tests/requirements.txt b/test/e2e/cws-tests/requirements.txt deleted file mode 100644 index cc9857c383b50..0000000000000 --- a/test/e2e/cws-tests/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -kubernetes==30.1.0 -datadog-api-client==2.27.0 -pyaml==24.7.0 -docker==7.1.0 -retry==0.9.2 -emoji==2.12.1 -requests==2.32.3 -jsonschema==4.23.0 \ No newline at end of file diff --git a/test/e2e/cws-tests/tests/lib/__init__.py b/test/e2e/cws-tests/tests/lib/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/test/e2e/cws-tests/tests/lib/common/app.py b/test/e2e/cws-tests/tests/lib/common/app.py deleted file mode 100644 index 37a8dd8b5829d..0000000000000 --- a/test/e2e/cws-tests/tests/lib/common/app.py +++ /dev/null @@ -1,31 +0,0 @@ -import time - -from datadog_api_client.v1 import ApiClient, Configuration -from datadog_api_client.v1.api.metrics_api import MetricsApi -from retry.api import retry_call - - -class App: - def __init__(self): - self.v1_api_client = ApiClient(Configuration()) - - def query_metric(self, name, **kw): - api_instance = MetricsApi(self.v1_api_client) - - tags = [] - for key, value in kw.items(): - tags.append(f"{key}:{value}") - if len(tags) == 0: - tags.append("*") - - response = api_instance.query_metrics(int(time.time()) - 30, int(time.time()), f"{name}{{{','.join(tags)}}}") - return response - - def wait_for_metric(self, name, tries=30, delay=10, **kw): - def expect_metric(): - metric = self.query_metric(name, **kw) - if len(metric.get("series")) == 0: - raise LookupError(f"no value found in {metric}") - return metric - - return retry_call(expect_metric, tries=tries, delay=delay) diff --git a/test/e2e/cws-tests/tests/lib/config.py b/test/e2e/cws-tests/tests/lib/config.py deleted file mode 100644 index 6051bee608045..0000000000000 --- a/test/e2e/cws-tests/tests/lib/config.py +++ /dev/null @@ -1,45 +0,0 @@ -import tempfile - -import yaml - - -def gen_system_probe_config(npm_enabled=False, rc_enabled=False, log_level="INFO", log_patterns=None): - fp = tempfile.NamedTemporaryFile(prefix="e2e-system-probe-", mode="w", delete=False) - - if not log_patterns: - log_patterns = [] - - data = { - "system_probe_config": {"log_level": log_level}, - "network_config": {"enabled": npm_enabled}, - "runtime_security_config": { - "log_patterns": log_patterns, - "network": {"enabled": True}, - "remote_configuration": {"enabled": rc_enabled, "refresh_interval": "5s"}, - }, - } - - yaml.dump(data, fp) - fp.close() - - return fp.name - - -def gen_datadog_agent_config(hostname="myhost", log_level="INFO", tags=None, rc_enabled=False, rc_key=None): - fp = tempfile.NamedTemporaryFile(prefix="e2e-datadog-agent-", mode="w", delete=False) - - if not tags: - tags = [] - - data = { - "log_level": log_level, - "hostname": hostname, - "tags": tags, - "security_agent.remote_workloadmeta": True, - "remote_configuration": {"enabled": rc_enabled, "refresh_interval": "5s", "key": rc_key}, - } - - yaml.dump(data, fp) - fp.close() - - return fp.name diff --git a/test/e2e/cws-tests/tests/lib/const.py b/test/e2e/cws-tests/tests/lib/const.py deleted file mode 100644 index 7dc3c90a1d31c..0000000000000 --- a/test/e2e/cws-tests/tests/lib/const.py +++ /dev/null @@ -1,3 +0,0 @@ -SECURITY_START_LOG = "Successfully connected to the runtime security module" -SYS_PROBE_START_LOG = "runtime security started" -SEC_AGENT_PATH = "/opt/datadog-agent/embedded/bin/security-agent" diff --git a/test/e2e/cws-tests/tests/lib/cspm/api.py b/test/e2e/cws-tests/tests/lib/cspm/api.py deleted file mode 100644 index a139c99ab9a3b..0000000000000 --- a/test/e2e/cws-tests/tests/lib/cspm/api.py +++ /dev/null @@ -1,56 +0,0 @@ -import os - -import lib.common.app as common -import requests -from retry.api import retry_call - - -def aggregate_logs(query, track): - site = os.environ["DD_SITE"] - api_key = os.environ["DD_API_KEY"] - app_key = os.environ["DD_APP_KEY"] - - url = f"https://api.{site}/api/v2/logs/analytics/aggregate?type={track}" - body = { - "compute": [{"aggregation": "count", "type": "total"}], - "filter": { - "from": "now-3m", - "to": "now", - "query": query, - }, - } - - r = requests.post( - url, - headers={"DD-API-KEY": api_key, "DD-APPLICATION-KEY": app_key}, - json=body, - ) - api_response = r.json() - if not api_response["data"] or not api_response["data"]["buckets"]: - raise LookupError(query) - - count = api_response["data"]["buckets"][0]["computes"]["c0"] - if count == 0: - raise LookupError(query) - - return api_response - - -def fetch_app_findings(query): - return aggregate_logs(query, track="cpfinding") - - -def fetch_app_compliance_event(query): - return aggregate_logs(query, track="compliance") - - -def wait_for_findings(query, tries=30, delay=5): - return retry_call(fetch_app_findings, fargs=[query], tries=tries, delay=delay) - - -def wait_for_compliance_event(query, tries=30, delay=5): - return retry_call(fetch_app_compliance_event, fargs=[query], tries=tries, delay=delay) - - -class App(common.App): - pass diff --git a/test/e2e/cws-tests/tests/lib/cspm/finding.py b/test/e2e/cws-tests/tests/lib/cspm/finding.py deleted file mode 100644 index e3a7839cc3f52..0000000000000 --- a/test/e2e/cws-tests/tests/lib/cspm/finding.py +++ /dev/null @@ -1,27 +0,0 @@ -import json - - -def extract_findings(lines): - if not lines: - return [] - - res_lines = ["["] - for line in lines: - if line == "}": - res_lines.append("},") - else: - res_lines.append(line) - res_lines.pop() - res_lines.extend(["}", "]"]) - return json.loads("".join(res_lines)) - - -def is_subset(subset, superset): - if isinstance(subset, dict): - return all(key in superset and is_subset(val, superset[key]) for key, val in subset.items()) - - if isinstance(subset, list) or isinstance(subset, set): - return all(any(is_subset(subitem, superitem) for superitem in superset) for subitem in subset) - - # assume that subset is a plain value if none of the above match - return subset == superset diff --git a/test/e2e/cws-tests/tests/lib/docker.py b/test/e2e/cws-tests/tests/lib/docker.py deleted file mode 100644 index 40047900f968e..0000000000000 --- a/test/e2e/cws-tests/tests/lib/docker.py +++ /dev/null @@ -1,154 +0,0 @@ -import os -import tarfile -import tempfile - -import docker -from retry.api import retry_call - -from lib.const import SEC_AGENT_PATH -from lib.log import LogGetter - - -def is_container_running(container): - container.reload() - if container.status != "running": - raise Exception - - -class DockerHelper(LogGetter): - def __init__(self): - self.client = docker.from_env() - - self.agent_container = None - - def start_cspm_agent(self, image, datadog_agent_config=None): - volumes = [ - "/var/run/docker.sock:/var/run/docker.sock:ro", - "/proc/:/host/proc/:ro", - "/sys/fs/cgroup/:/host/sys/fs/cgroup:ro", - "/etc/passwd:/etc/passwd:ro", - "/etc/os-release:/host/etc/os-release:ro", - "/:/host/root:ro", - ] - - if datadog_agent_config: - volumes.append(f"{datadog_agent_config}:/etc/datadog-agent/datadog.yaml") - - site = os.environ["DD_SITE"] - api_key = os.environ["DD_API_KEY"] - - self.agent_container = self.client.containers.run( - image, - environment=[ - "DD_COMPLIANCE_CONFIG_ENABLED=true", - "HOST_ROOT=/host/root", - f"DD_SITE={site}", - f"DD_API_KEY={api_key}", - ], - volumes=volumes, - detach=True, - ) - - return self.agent_container - - def start_cws_agent(self, image, datadog_agent_config=None, system_probe_config=None): - volumes = [ - "/var/run/docker.sock:/var/run/docker.sock:ro", - "/proc/:/host/proc/:ro", - "/sys/fs/cgroup/:/host/sys/fs/cgroup:ro", - "/etc/passwd:/etc/passwd:ro", - "/etc/group:/etc/group:ro", - "/:/host/root:ro", - "/sys/kernel/debug:/sys/kernel/debug", - "/etc/os-release:/etc/os-release", - ] - - if datadog_agent_config: - volumes.append(f"{datadog_agent_config}:/etc/datadog-agent/datadog.yaml") - - if system_probe_config: - volumes.append(f"{system_probe_config}:/etc/datadog-agent/system-probe.yaml") - - site = os.environ["DD_SITE"] - api_key = os.environ["DD_API_KEY"] - - self.agent_container = self.client.containers.run( - image, - cap_add=["SYS_ADMIN", "SYS_RESOURCE", "SYS_PTRACE", "NET_ADMIN", "IPC_LOCK"], - security_opt=["apparmor:unconfined"], - environment=[ - "DD_RUNTIME_SECURITY_CONFIG_ENABLED=true", - "DD_SYSTEM_PROBE_ENABLED=true", - "HOST_ROOT=/host/root", - f"DD_SITE={site}", - f"DD_API_KEY={api_key}", - ], - volumes=volumes, - detach=True, - ) - - return self.agent_container - - def download_policies(self): - command = SEC_AGENT_PATH + " runtime policy download" - site = os.environ["DD_SITE"] - api_key = os.environ["DD_API_KEY"] - app_key = os.environ["DD_APP_KEY"] - return self.agent_container.exec_run( - command, - stderr=False, - stdout=True, - stream=False, - environment=[ - f"DD_SITE={site}", - f"DD_API_KEY={api_key}", - f"DD_APP_KEY={app_key}", - ], - ) - - def push_policies(self, policies): - temppolicy = tempfile.NamedTemporaryFile(prefix="e2e-policy-", mode="w", delete=False) - temppolicy.write(policies) - temppolicy.close() - temppolicy_path = temppolicy.name - self.cp_file(temppolicy_path, "/etc/datadog-agent/runtime-security.d/default.policy") - os.remove(temppolicy_path) - - def cp_file(self, src, dst): - tar = tarfile.open(src + '.tar', mode='w') - try: - tar.add(src) - finally: - tar.close() - data = open(src + '.tar', 'rb').read() - self.agent_container.put_archive("/tmp", data) - self.agent_container.exec_run("mv /tmp/" + src + " " + dst) - - def reload_policies(self): - self.agent_container.exec_run(SEC_AGENT_PATH + " runtime policy reload") - - def wait_agent_container(self, tries=10, delay=5): - return retry_call(is_container_running, fargs=[self.agent_container], tries=tries, delay=delay) - - def get_log(self, agent_name): - log_prefix = None - if agent_name == "security-agent": - log_prefix = "SECURITY" - elif agent_name == "system-probe": - log_prefix = "SYS-PROBE" - else: - raise LookupError(agent_name) - - log = self.agent_container.logs(since=1).decode("utf-8") - - result = [line for line in log.splitlines() if log_prefix in line] - if result: - return result - raise LookupError(agent_name) - - def close(self): - if self.agent_container: - self.agent_container.stop() - self.agent_container.remove() - - self.client.close() diff --git a/test/e2e/cws-tests/tests/lib/kubernetes.py b/test/e2e/cws-tests/tests/lib/kubernetes.py deleted file mode 100644 index 6d5e4267150e2..0000000000000 --- a/test/e2e/cws-tests/tests/lib/kubernetes.py +++ /dev/null @@ -1,123 +0,0 @@ -import os -import tarfile -import tempfile - -from kubernetes import client, config -from kubernetes.stream import stream - -from lib.const import SEC_AGENT_PATH -from lib.log import LogGetter - - -class KubernetesHelper(LogGetter): - def __init__(self, namespace, in_cluster=False): - if in_cluster: - config.load_incluster_config() - else: - config.load_kube_config() - - self.api_client = client.CoreV1Api() - - self.namespace = namespace - self.pod_name = None - - def select_pod_name(self, label_selector): - resp = self.api_client.list_namespaced_pod(namespace=self.namespace, label_selector=label_selector) - for i in resp.items: - self.pod_name = i.metadata.name - return - raise LookupError(label_selector) - - def get_log(self, agent_name): - log = self.api_client.read_namespaced_pod_log( - name=self.pod_name, namespace=self.namespace, container=agent_name, follow=False, tail_lines=10000 - ) - - return log.splitlines() - - def exec_command(self, container, command=None): - if not command: - command = [] - - return stream( - self.api_client.connect_post_namespaced_pod_exec, - name=self.pod_name, - namespace=self.namespace, - container=container, - command=command, - stderr=False, - stdin=False, - stdout=True, - tty=False, - ) - - def reload_policies(self): - command = [SEC_AGENT_PATH, 'runtime', 'policy', 'reload'] - self.exec_command("security-agent", command=command) - - def download_policies(self): - site = os.environ["DD_SITE"] - api_key = os.environ["DD_API_KEY"] - app_key = os.environ["DD_APP_KEY"] - command = [ - "/bin/bash", - "-c", - "export DD_SITE=" - + site - + " ; export DD_API_KEY=" - + api_key - + " ; export DD_APP_KEY=" - + app_key - + " ; " - + SEC_AGENT_PATH - + " runtime policy download", - ] - return self.exec_command("security-agent", command=command) - - def push_policies(self, policies): - temppolicy = tempfile.NamedTemporaryFile(prefix="e2e-policy-", mode="w", delete=False) - temppolicy.write(policies) - temppolicy.close() - temppolicy_path = temppolicy.name - self.exec_command("security-agent", command=["mkdir", "-p", "/tmp/runtime-security.d"]) - self.cp_to_agent("security-agent", temppolicy_path, "/tmp/runtime-security.d/downloaded.policy") - os.remove(temppolicy_path) - - def cp_to_agent(self, agent_name, src_file, dst_file): - command = ['tar', 'xvf', '-', '-C', '/tmp'] - resp = stream( - self.api_client.connect_post_namespaced_pod_exec, - name=self.pod_name, - namespace=self.namespace, - container=agent_name, - command=command, - stderr=True, - stdin=True, - stdout=True, - tty=False, - _preload_content=False, - ) - - with tempfile.TemporaryFile() as tar_buffer: - with tarfile.open(fileobj=tar_buffer, mode='w') as tar: - tar.add(src_file) - - tar_buffer.seek(0) - commands = [] - commands.append(tar_buffer.read()) - - while resp.is_open(): - resp.update(timeout=1) - if commands: - c = commands.pop(0) - resp.write_stdin(c) - else: - break - resp.close() - - dirname = os.path.dirname(dst_file) - command = ['mkdir', '-p', dirname] - self.exec_command(agent_name, command=command) - - command = ['mv', f'/tmp/{src_file}', dst_file] - self.exec_command(agent_name, command=command) diff --git a/test/e2e/cws-tests/tests/lib/log.py b/test/e2e/cws-tests/tests/lib/log.py deleted file mode 100644 index 5bbf5c1d3349e..0000000000000 --- a/test/e2e/cws-tests/tests/lib/log.py +++ /dev/null @@ -1,21 +0,0 @@ -from abc import ABC, abstractmethod - -from retry.api import retry_call - - -class LogGetter(ABC): - @abstractmethod - def get_log(self, _agent_name): - raise NotImplementedError() - - -def _wait_agent_log(agent_name, log_getter, pattern): - lines = log_getter.get_log(agent_name) - for line in lines: - if pattern in line: - return - raise LookupError(f"{agent_name} | {pattern}") - - -def wait_agent_log(agent_name, log_getter, pattern, tries=10, delay=5): - return retry_call(_wait_agent_log, fargs=[agent_name, log_getter, pattern], tries=tries, delay=delay) diff --git a/test/e2e/cws-tests/tests/lib/stepper.py b/test/e2e/cws-tests/tests/lib/stepper.py deleted file mode 100644 index fbfec4312c060..0000000000000 --- a/test/e2e/cws-tests/tests/lib/stepper.py +++ /dev/null @@ -1,18 +0,0 @@ -import emoji - - -class Step: - def __init__(self, msg="", emoji=""): - self.msg = msg - self.emoji = emoji - - def __enter__(self): - _emoji = emoji.emojize(self.emoji) - print(f"{_emoji} {self.msg}... ", end="", flush=True) - return self - - def __exit__(self, exc_type, _exc_val, _exc_tb): - if exc_type is None: - print(emoji.emojize(":check_mark:"), flush=True) - else: - print(emoji.emojize(":cross_mark:"), flush=True) diff --git a/test/e2e/cws-tests/tests/test_e2e_cspm.py b/test/e2e/cws-tests/tests/test_e2e_cspm.py deleted file mode 100644 index 57b0ac3f3ae44..0000000000000 --- a/test/e2e/cws-tests/tests/test_e2e_cspm.py +++ /dev/null @@ -1,34 +0,0 @@ -from lib.cspm.finding import is_subset - - -def expect_findings(test_case, findings, expected_findings): - findings_by_rule = {} - for agent_rule_id, rule_findings in findings.items(): - findings_by_rule.setdefault(agent_rule_id, []).extend(rule_findings) - for finding in rule_findings: - print(f"finding {agent_rule_id} {finding}") - - for rule_id, expected_rule_findings in expected_findings.items(): - for expected_rule_finding in expected_rule_findings: - test_case.assertIn(rule_id, findings_by_rule) - found = False - rule_findings = findings_by_rule.get(rule_id, []) - for finding in rule_findings: - if is_subset(expected_rule_finding, finding): - found = True - break - - test_case.assertTrue(found, f"unexpected finding {finding} for rule {rule_id}") - del findings_by_rule[rule_id] - - for rule_id, rule_findings in findings_by_rule.items(): - for finding in rule_findings: - result = finding["result"] - print(f"finding {rule_id} {result}") - - for rule_id, rule_findings in findings_by_rule.items(): - for finding in rule_findings: - result = finding["result"] - test_case.assertNotIn( - result, ("failed", "error"), f"finding for rule {rule_id} not expected to be in failed or error state" - ) diff --git a/test/e2e/cws-tests/tests/test_e2e_cspm_docker.py b/test/e2e/cws-tests/tests/test_e2e_cspm_docker.py deleted file mode 100644 index bbc365807542c..0000000000000 --- a/test/e2e/cws-tests/tests/test_e2e_cspm_docker.py +++ /dev/null @@ -1,150 +0,0 @@ -import json -import os -import socket -import time -import unittest -import uuid -import warnings - -from lib.config import gen_datadog_agent_config -from lib.cspm.api import App -from lib.docker import DockerHelper -from lib.stepper import Step -from test_e2e_cspm import expect_findings - - -class TestE2EDocker(unittest.TestCase): - def setUp(self): - warnings.simplefilter("ignore", category=ResourceWarning) - warnings.simplefilter("ignore", category=UserWarning) - - self.docker_helper = DockerHelper() - self.app = App() - - def tearDown(self): - self.docker_helper.close() - - def test_privileged_container(self): - print("") - - test_id = str(uuid.uuid4())[:4] - with Step(msg="create privileged container", emoji=":construction:"): - pc = self.docker_helper.client.containers.run( - "ubuntu:latest", - command="sleep 7200", - detach=True, - remove=True, - privileged=True, - ) - self.container_id = pc.id - - with Step(msg="check agent start", emoji=":man_running:"): - image = os.getenv("DD_AGENT_IMAGE") - hostname = f"host_{test_id}" - self.datadog_agent_config = gen_datadog_agent_config( - hostname=hostname, log_level="DEBUG", tags=["tag1", "tag2"] - ) - - self.container = self.docker_helper.start_cspm_agent( - image, - datadog_agent_config=self.datadog_agent_config, - ) - self.assertIsNotNone(self.container, msg="unable to start container") - - self.docker_helper.wait_agent_container() - - with Step(msg="check agent events", emoji=":check_mark_button:"): - self.container.exec_run("security-agent compliance check --dump-reports /tmp/reports.json --report") - _, output = self.container.exec_run("cat /tmp/reports.json") - print(output) - findings = json.loads(output) - - expected_findings = { - "cis-docker-1.2.0-5.4": [ - { - "agent_rule_id": "cis-docker-1.2.0-5.4", - "agent_framework_id": "cis-docker", - "result": "failed", - "resource_type": "docker_container", - "data": { - "container.id": self.container_id, - }, - } - ], - "cis-docker-1.2.0-1.2.1": [{"result": "failed"}], - "cis-docker-1.2.0-1.2.3": [{"result": "error"}], - "cis-docker-1.2.0-1.2.4": [{"result": "error"}], - "cis-docker-1.2.0-1.2.5": [{"result": "error"}], - "cis-docker-1.2.0-1.2.6": [{"result": "error"}], - "cis-docker-1.2.0-1.2.7": [{"result": "error"}], - "cis-docker-1.2.0-1.2.8": [{"result": "error"}], - "cis-docker-1.2.0-1.2.9": [{"result": "error"}], - "cis-docker-1.2.0-1.2.10": [{"result": "error"}], - "cis-docker-1.2.0-1.2.11": [{"result": "error"}], - "cis-docker-1.2.0-1.2.12": [{"result": "error"}], - "cis-docker-1.2.0-2.2": [{"result": "failed"}], - "cis-docker-1.2.0-2.3": [{"result": "failed"}], - "cis-docker-1.2.0-2.4": [{"result": "failed"}], - "cis-docker-1.2.0-2.6": [{"result": "failed"}], - "cis-docker-1.2.0-3.10": [{"result": "error"}], - "cis-docker-1.2.0-3.11": [{"result": "error"}], - "cis-docker-1.2.0-3.12": [{"result": "error"}], - "cis-docker-1.2.0-3.13": [{"result": "error"}], - "cis-docker-1.2.0-3.14": [{"result": "error"}], - "cis-docker-1.2.0-3.15": [{"result": "error"}], - "cis-docker-1.2.0-3.16": [{"result": "error"}], - "cis-docker-1.2.0-3.17": [{"result": "error"}], - "cis-docker-1.2.0-3.18": [{"result": "error"}], - "cis-docker-1.2.0-3.19": [{"result": "error"}], - "cis-docker-1.2.0-3.20": [{"result": "error"}], - "cis-docker-1.2.0-3.21": [{"result": "error"}], - "cis-docker-1.2.0-3.22": [{"result": "error"}], - "cis-docker-1.2.0-3.7": [{"result": "error"}], - "cis-docker-1.2.0-3.8": [{"result": "error"}], - "cis-docker-1.2.0-3.9": [{"result": "error"}], - "cis-docker-1.2.0-4.1": [{"result": "failed"}], - "cis-docker-1.2.0-4.6": [{"result": "failed"}], - "cis-docker-1.2.0-5.1": [{"result": "failed"}], - "cis-docker-1.2.0-5.10": [{"result": "failed"}], - "cis-docker-1.2.0-5.11": [{"result": "failed"}], - "cis-docker-1.2.0-5.12": [{"result": "failed"}], - "cis-docker-1.2.0-5.14": [{"result": "failed"}], - "cis-docker-1.2.0-5.2": [{"result": "error"}], - "cis-docker-1.2.0-5.25": [{"result": "failed"}], - "cis-docker-1.2.0-5.26": [{"result": "failed"}], - "cis-docker-1.2.0-5.28": [{"result": "failed"}], - "cis-docker-1.2.0-5.31": [{"result": "failed"}], - "cis-docker-1.2.0-5.7": [{"result": "failed"}], - } - - expect_findings(self, findings, expected_findings) - - with Step(msg="wait for intake (~1m)", emoji=":alarm_clock:"): - time.sleep(1 * 60) - - with Step(msg="wait for datadog.security_agent.compliance.running metric", emoji="\N{BEER MUG}"): # fmt: off - self.app.wait_for_metric("datadog.security_agent.compliance.running", host=socket.gethostname()) - - ## Disabled while no CSPM API is available - # with Step(msg="check app compliance event", emoji=":SOON_arrow:"): - # wait_for_compliance_event(f"resource_id:*{self.container_id}") - - with Step(msg="wait for finding generation (~1m)", emoji=":alarm_clock:"): - time.sleep(1 * 60) - - with Step(msg="wait for datadog.security_agent.compliance.containers_running metric", emoji="\N{BEER MUG}"): # fmt: off - self.app.wait_for_metric( - "datadog.security_agent.compliance.containers_running", container_id=self.container_id - ) - - ## Disabled while no CSPM API is available - # with Step(msg="check app finding", emoji=":chart_increasing_with_yen:"): - # wait_for_findings(f"@resource_type:docker_container @container_id:{self.container_id}") - - -def main(): - unittest.main() - - -if __name__ == "__main__": - main() diff --git a/test/e2e/cws-tests/tests/test_e2e_cspm_kubernetes.py b/test/e2e/cws-tests/tests/test_e2e_cspm_kubernetes.py deleted file mode 100644 index ef0871c049f30..0000000000000 --- a/test/e2e/cws-tests/tests/test_e2e_cspm_kubernetes.py +++ /dev/null @@ -1,224 +0,0 @@ -import argparse -import sys -import time -import unittest -import warnings - -import emoji -from lib.cspm.api import App -from lib.kubernetes import KubernetesHelper -from lib.stepper import Step -from test_e2e_cspm import expect_findings - - -class TestE2EKubernetes(unittest.TestCase): - namespace = "default" - in_cluster = False - expectedFindingsMasterEtcdNode = { - "cis-kubernetes-1.5.1-1.1.12": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.16": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.19": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.21": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.22": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.23": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.24": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.25": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.26": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.33": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.2.6": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.3.2": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.3.3": [ - { - "result": "passed", - } - ], - "cis-kubernetes-1.5.1-1.3.4": [ - { - "result": "passed", - } - ], - "cis-kubernetes-1.5.1-1.3.5": [ - { - "result": "passed", - } - ], - "cis-kubernetes-1.5.1-1.3.6": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-1.3.7": [ - { - "result": "passed", - } - ], - "cis-kubernetes-1.5.1-1.4.1": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-3.2.1": [ - { - "result": "failed", - } - ], - } - expectedFindingsWorkerNode = { - "cis-kubernetes-1.5.1-4.2.1": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-4.2.3": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-4.2.4": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-4.2.5": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-4.2.6": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-4.2.10": [ - { - "result": "failed", - } - ], - "cis-kubernetes-1.5.1-4.2.12": [ - { - "result": "failed", - } - ], - } - hostname = "k8s-e2e-tests-control-plane" - - def setUp(self): - warnings.simplefilter("ignore", category=ResourceWarning) - warnings.simplefilter("ignore", category=UserWarning) - warnings.simplefilter("ignore", category=DeprecationWarning) - - self.kubernetes_helper = KubernetesHelper(namespace=self.namespace, in_cluster=self.in_cluster) - self.resource_id = "k8s-e2e-tests-control-plane_kubernetes_*_node" - self.app = App() - - def test_k8s(self): - print("") - - agent_name = "security-agent" - - with Step(msg="select pod", emoji=":man_running:"): - self.kubernetes_helper.select_pod_name("app.kubernetes.io/component=agent") - - with Step(msg="check agent events", emoji=":check_mark_button:"): - self.kubernetes_helper.exec_command( - agent_name, ["security-agent", "compliance", "check", "--dump-reports", "/tmp/reports", "--report"] - ) - output = self.kubernetes_helper.exec_command(agent_name, ["bash", "-c", "cat /tmp/reports"]) - print(output) - # if the output is JSON, it automatically calls json.loads on it. Yeah, I know... I've felt the same too - findings = eval(output) - expected_findings = dict( - **TestE2EKubernetes.expectedFindingsMasterEtcdNode, **TestE2EKubernetes.expectedFindingsWorkerNode - ) - expect_findings(self, findings, expected_findings) - - with Step(msg="wait for intake (~1m)", emoji=":alarm_clock:"): - time.sleep(1 * 60) - - with Step(msg="wait for datadog.security_agent.compliance.running metric", emoji="\N{beer mug}"): # fmt: off - self.app.wait_for_metric("datadog.security_agent.compliance.running", host=TestE2EKubernetes.hostname) - - ## Disabled while no CSPM API is available - # with Step(msg="check app compliance event", emoji=":SOON_arrow:"): - # wait_for_compliance_event(f"resource_id:{self.resource_id}") - - with Step(msg="wait for finding generation (~1m)", emoji=":alarm_clock:"): - time.sleep(1 * 60) - - with Step(msg="wait for datadog.security_agent.compliance.containers_running metric", emoji="\N{beer mug}"): # fmt: off - self.app.wait_for_metric( - "datadog.security_agent.compliance.containers_running", host=TestE2EKubernetes.hostname - ) - - ## Disabled while no CSPM API is available - # with Step(msg="check app findings", emoji=":chart_increasing_with_yen:"): - # wait_for_findings(f"@resource_type:kubernetes_*_node @resource:{self.resource_id}") - - print(emoji.emojize(":heart_on_fire:"), flush=True) - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("--namespace", default="default") - parser.add_argument("--in-cluster", action="store_true") - parser.add_argument("unittest_args", nargs="*") - args = parser.parse_args() - - # setup some specific tests - TestE2EKubernetes.namespace = args.namespace - TestE2EKubernetes.in_cluster = args.in_cluster - - unit_argv = [sys.argv[0]] + args.unittest_args - unittest.main(argv=unit_argv) - - -if __name__ == "__main__": - main() diff --git a/test/e2e/docs/run-instance.svg b/test/e2e/docs/run-instance.svg deleted file mode 100644 index 082cdb69d0b99..0000000000000 --- a/test/e2e/docs/run-instance.svg +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
-
- - - - -
- -
-
-
-
- - - - -
- -
-
-
-
- - - - -
- -
-
-
-
- - - - -
- -
-
-
-
- - - - -
- wait completion -
-
-
-
- - - - -
- -
-
-
-
-
- - - - - - -
Run Instance
-
-
-
-
- - - - - -
kind create cluster
-
-
-
-
- - - - - -
kind cluster ready
-
-
-
-
- - - - - -
argo download
-
-
-
-
- - - - - -
argo setup
-
-
-
-
- - - - - -
argo submit
-
-
-
-
- - - - - -
argo get results
-
-
-
-
- - - - - -
exit with code
-
-
-
-
-
-
-
-
\ No newline at end of file diff --git a/test/e2e/docs/sequence.md b/test/e2e/docs/sequence.md deleted file mode 100644 index 7cbab0d4037e4..0000000000000 --- a/test/e2e/docs/sequence.md +++ /dev/null @@ -1,41 +0,0 @@ -# Generate sequence - -## Update process - -1. Copy paste the content of each sequence in the [online tool](https://github.com/mermaidjs/mermaid-live-editor). -2. Download the image generated -3. move it to replace the old one - -### Online data - -[setup-instance](../scripts/setup-instance): - -```text -graph TD -A{setup-instance} -->B(AWS specification) -B --> C[ignition] -C --> D(sshAuthorizedKeys) -D -->B -B --> E[ec2] -E --> F(request-spot-instances) -F --> G(describe-spot-instance-requests) -G -->|Instance created| H(create-tags) -H -->|instance and spot requests| I(describe-instances) -I -->|Get PrivateIpAddress| J(cancel-spot-instance-requests) -J --> K[ssh] -K --> L(git clone and checkout) -L --> M{run-instance} -``` - - -[run-instance](../scripts/run-instance) -```text -graph TD -A{Run Instance} -->B[kind create cluster] -B --> C[kind cluster ready] -C --> D[argo download] -D --> E[argo setup] -E --> F[argo submit] -F -->|wait completion| G[argo get results] -G --> H{exit with code} -``` diff --git a/test/e2e/docs/setup-instance.svg b/test/e2e/docs/setup-instance.svg deleted file mode 100644 index cc69bf8b9d108..0000000000000 --- a/test/e2e/docs/setup-instance.svg +++ /dev/null @@ -1,350 +0,0 @@ -
Instance created
instance and spot requests
Get PrivateIpAddress
setup-instance
AWS specification
ignition
sshAuthorizedKeys
ec2
request-spot-instances
describe-spot-instance-requests
create-tags
describe-instances
cancel-spot-instance-requests
ssh
git clone and checkout
run-instance
\ No newline at end of file diff --git a/test/e2e/scripts/generate-parameters.sh b/test/e2e/scripts/generate-parameters.sh deleted file mode 100755 index 5dffa47feabbf..0000000000000 --- a/test/e2e/scripts/generate-parameters.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash - -##### A script to generate a unique namespace ##### -##### and a parameters file for a workflow ##### - - -##### Exit on error ##### -set -e - -##### Source utility functions ##### -source utils.sh - -##### Functions ##### - -usage() -{ - echo 'Usage: ./generate-parameters.sh [[-w workflow -g workflow_group] | [-h]] -Example: ./generate-parameters.sh -g workflow_group -w workflow -Flags: --w, --workflow workflow name --g, --workflow-group workflow group name --o, --output-file generated yaml file name (default parameters.yaml) --d, --workflows-dir the directory where workflows are defined (default ../argo-workflows)' -} - -validate_input() -{ - # Validate workflow name characters - if ! [[ $WORKFLOW =~ ^[0-9a-zA-Z-]+$ ]]; then - echo "Error: Invalid workflow name format: $WORKFLOW" - exit 1 - fi - - # Validate workflow group name characters - if ! [[ $WORKFLOW_GROUP =~ ^[0-9a-zA-Z._-]+$ ]]; then - echo "Error: Invalid workflow group name format: $WORKFLOW_GROUP" - exit 1 - fi -} - -# Usage: generate_parameters -generate_parameters() -{ - # Merging parameters - echo 'Info: Merging parameters...' - YK_MERGE_COMMAND='yq merge --overwrite --allow-empty' - DEFAULT_GLOBAL_PARAM="$WORKFLOWS_DIR/defaults/parameters.yaml" - DEFAULT_GROUP_PARAM="$WORKFLOWS_DIR/$WORKFLOW_GROUP/defaults/parameters.yaml" - WORKFLOW_PARAM="$WORKFLOWS_DIR/$WORKFLOW_GROUP/$WORKFLOW/parameters.yaml" - TMP_YAML_PATH="$1.tmp.yaml" - $YK_MERGE_COMMAND "$DEFAULT_GLOBAL_PARAM" "$DEFAULT_GROUP_PARAM" "$WORKFLOW_PARAM" > "$TMP_YAML_PATH" - - # Rendering namespace - echo 'Info: Parameters merged, rendering namespace and saving file...' - NAMESPACE_TEMPLATE_VAR="{{ namespace }}" - sed -e "s/$NAMESPACE_TEMPLATE_VAR/$1/g" "$TMP_YAML_PATH" > "$OUTPUT_YAML_FILE" - echo "Info: Generated parameters, yaml file saved: $OUTPUT_YAML_FILE" - - # Cleanup temp file - rm "$TMP_YAML_PATH" -} - - -##### Main ##### - -WORKFLOW="" -WORKFLOW_GROUP="" -NAMESPACE="" -OUTPUT_YAML_FILE="parameters.yaml" -WORKFLOWS_DIR="../argo-workflows" - -if [ "$1" == "" ]; then - usage - exit 1 -fi - -while [ "$1" != "" ]; do - case $1 in - -w | --workflow ) shift - WORKFLOW=$1 - ;; - -g | --workflow-group ) shift - WORKFLOW_GROUP=$1 - ;; - -o | --output-file ) shift - OUTPUT_YAML_FILE=$1 - ;; - -d | --workflows-dir ) shift - WORKFLOWS_DIR=$1 - ;; - -h | --help ) usage - exit - ;; - * ) usage - exit 1 - esac - shift -done - -# Only proceed when `yq` is installed -check_yq_installed - -# Validate the parameters -validate_input - -# Generate namespace -generate_namespace "$WORKFLOW_GROUP" "$WORKFLOW" - -# Generate the parameters file -generate_parameters "$NAMESPACE" diff --git a/test/e2e/scripts/run-instance/.gitignore b/test/e2e/scripts/run-instance/.gitignore deleted file mode 100644 index 9e2dbce48e383..0000000000000 --- a/test/e2e/scripts/run-instance/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -argo -argo.gz diff --git a/test/e2e/scripts/run-instance/10-setup-kind.sh b/test/e2e/scripts/run-instance/10-setup-kind.sh deleted file mode 100755 index bcb879510b035..0000000000000 --- a/test/e2e/scripts/run-instance/10-setup-kind.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -arch="" -case $(uname -m) in - x86_64) arch="amd64" ;; - aarch64) arch="arm64" ;; - *) - echo "Unsupported architecture" - exit 1 - ;; -esac - -download_and_install_kubectl() { - curl --retry 5 --fail --retry-all-errors -LO "https://dl.k8s.io/release/$(curl --retry 5 --fail --retry-all-errors -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$arch/kubectl" - sudo install kubectl /usr/local/bin/kubectl -} - -printf '=%.0s' {0..79} ; echo - -if [[ $(uname) == "Darwin" ]] -then - echo "Kind setup should not be run on Darwin" - exit 1 -fi - - -# if kubctl is not here, download it -if [[ ! -f ./kubectl ]]; then - download_and_install_kubectl -else - # else, download the SHA256 of the wanted version - curl --retry 5 --fail --retry-all-errors -LO "https://dl.k8s.io/release/$(curl --retry 5 --fail --retry-all-errors -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$arch/kubectl.sha256" - # And if it differs, force the download again - if ! echo "$(/dev/null 2>&1; then - # skip the usermod step if needless - sudo usermod -a -G docker core -fi - -echo "Kind setup finished" diff --git a/test/e2e/scripts/run-instance/11-setup-kind-cluster.sh b/test/e2e/scripts/run-instance/11-setup-kind-cluster.sh deleted file mode 100755 index 812a37c58943b..0000000000000 --- a/test/e2e/scripts/run-instance/11-setup-kind-cluster.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -printf '=%.0s' {0..79} ; echo - -is_cluster_running=$(kind get clusters|grep k8s-e2e-tests||echo none) -if [ "$is_cluster_running" == "k8s-e2e-tests" ]; then - echo "Cleanup: deleting cluster k8s-e2e-tests" - kind delete cluster --name k8s-e2e-tests -fi - -echo "Setup kind cluster: k8s-e2e-tests" -SCRIPT_DIR=$(dirname "$(readlink -f "$0")") -kind create cluster --name k8s-e2e-tests --wait 10m --config "$SCRIPT_DIR/kind-cluster.yaml" diff --git a/test/e2e/scripts/run-instance/20-argo-download.sh b/test/e2e/scripts/run-instance/20-argo-download.sh deleted file mode 100755 index a29702de2fd27..0000000000000 --- a/test/e2e/scripts/run-instance/20-argo-download.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -euo pipefail - -printf '=%.0s' {0..79} ; echo - -cd "$(dirname "$0")" - -set -e - -arch="" -case $(uname -m) in - x86_64) arch="amd64" ;; - aarch64) arch="arm64" ;; - *) - echo "Unsupported architecture" - exit 1 - ;; -esac - -# if argo is not here, or if the SHA doesnt match, (re)download it -if [[ ! -f ./argo.gz ]] || ! sha256sum -c "argo.$arch.sha256sum" ; then - curl -Lf "https://github.com/argoproj/argo-workflows/releases/download/v3.4.3/argo-linux-$arch.gz" -o argo.gz - # before gunziping it, check its SHA - if ! sha256sum -c "argo.$arch.sha256sum"; then - echo "SHA256 of argo.gz differs, exiting." - exit 1 - fi -fi -if [[ ! -f ./argo. ]]; then - gunzip -kf argo.gz -fi -chmod +x ./argo -./argo version diff --git a/test/e2e/scripts/run-instance/21-argo-setup.sh b/test/e2e/scripts/run-instance/21-argo-setup.sh deleted file mode 100755 index 1dae3970954a4..0000000000000 --- a/test/e2e/scripts/run-instance/21-argo-setup.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -euo pipefail - -printf '=%.0s' {0..79} ; echo - -cd "$(dirname "$0")" - -for i in {0..60} -do - kubectl get hpa,svc,ep,ds,deploy,job,po --all-namespaces -o wide && break - sleep 5 -done - -set -e - -kubectl create namespace argo -kubectl apply -n argo -f https://github.com/argoproj/argo-workflows/releases/download/v3.4.3/install.yaml - -# TODO use a more restrictive SA -kubectl apply -f - << EOF -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: argo-admin -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-admin -subjects: -- kind: ServiceAccount - name: default - namespace: default -EOF - -set +e - -for i in {0..60} -do - ./argo list && exit 0 - kubectl get hpa,svc,ep,ds,deploy,job,po --all-namespaces -o wide - sleep 5 -done - -exit 1 diff --git a/test/e2e/scripts/run-instance/22-argo-submit.sh b/test/e2e/scripts/run-instance/22-argo-submit.sh deleted file mode 100755 index 9c59119372ee5..0000000000000 --- a/test/e2e/scripts/run-instance/22-argo-submit.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -set -euo pipefail - -printf '=%.0s' {0..79} ; echo - -# ${DATADOG_AGENT_IMAGE} and ${DATADOG_CLUSTER_AGENT_IMAGE} are provided by the CI -if [[ -z ${DATADOG_AGENT_IMAGE:+x} ]] || [[ -z ${DATADOG_CLUSTER_AGENT_IMAGE:+x} ]]; then - echo "DATADOG_AGENT_IMAGE and DATADOG_CLUSTER_AGENT_IMAGE environment variables need to be set" >&2 - exit 2 -fi - -ARGO_WORKFLOW=${ARGO_WORKFLOW:-''} - -echo "DATADOG_AGENT_IMAGE=${DATADOG_AGENT_IMAGE}" -echo "DATADOG_CLUSTER_AGENT_IMAGE=${DATADOG_CLUSTER_AGENT_IMAGE}" -echo "ARGO_WORKFLOW=${ARGO_WORKFLOW}" - -cd "$(dirname "$0")" - -if [[ -n ${DOCKER_REGISTRY_URL+x} ]] && [[ -n ${DOCKER_REGISTRY_LOGIN+x} ]] && [[ -n ${DOCKER_REGISTRY_PWD+x} ]]; then - oldstate=$(shopt -po xtrace ||:); set +x # Do not log credentials - kubectl create secret docker-registry docker-registry --docker-server="$DOCKER_REGISTRY_URL" --docker-username="$DOCKER_REGISTRY_LOGIN" --docker-password="$DOCKER_REGISTRY_PWD" - eval "$oldstate" -fi - -argo_submit_cws_cspm() { - DATADOG_AGENT_SITE=${DATADOG_AGENT_SITE:-""} - - oldstate=$(shopt -po xtrace ||:); set +x # Do not log credentials - - if [[ -z ${DATADOG_AGENT_API_KEY:+x} ]] || [[ -z ${DATADOG_AGENT_APP_KEY:+x} ]]; then - echo "DATADOG_AGENT_API_KEY, DATADOG_AGENT_APP_KEY environment variables need to be set" >&2 - exit 2 - fi - - kubectl create secret generic dd-keys \ - --from-literal=DD_API_KEY="${DATADOG_AGENT_API_KEY}" \ - --from-literal=DD_APP_KEY="${DATADOG_AGENT_APP_KEY}" \ - --from-literal=DD_DDDEV_API_KEY="${DD_API_KEY}" - - eval "$oldstate" - - ./argo template create ../../argo-workflows/templates/*.yaml - ./argo submit ../../argo-workflows/$1 --wait \ - --parameter datadog-agent-image-repository="${DATADOG_AGENT_IMAGE%:*}" \ - --parameter datadog-agent-image-tag="${DATADOG_AGENT_IMAGE#*:}" \ - --parameter datadog-cluster-agent-image-repository="${DATADOG_CLUSTER_AGENT_IMAGE%:*}" \ - --parameter datadog-cluster-agent-image-tag="${DATADOG_CLUSTER_AGENT_IMAGE#*:}" \ - --parameter datadog-agent-site="${DATADOG_AGENT_SITE#*:}" \ - --parameter ci_commit_short_sha="${CI_COMMIT_SHORT_SHA:-unknown}" \ - --parameter ci_pipeline_id="${CI_PIPELINE_ID:-unknown}" \ - --parameter ci_job_id="${CI_JOB_ID:-unknown}" || : -} - -case "$ARGO_WORKFLOW" in - "cspm") - argo_submit_cws_cspm cspm-workflow.yaml - ;; - *) - kubectl create secret generic dd-keys \ - --from-literal=DD_API_KEY=123er \ - --from-literal=DD_APP_KEY=123er1 \ - --from-literal=DD_DDDEV_API_KEY="${DD_API_KEY}" - - ./argo template create ../../argo-workflows/templates/*.yaml - ./argo submit "../../argo-workflows/${ARGO_WORKFLOW}-workflow.yaml" --wait \ - --parameter datadog-agent-image-repository="${DATADOG_AGENT_IMAGE%:*}" \ - --parameter datadog-agent-image-tag="${DATADOG_AGENT_IMAGE#*:}" \ - --parameter datadog-cluster-agent-image-repository="${DATADOG_CLUSTER_AGENT_IMAGE%:*}" \ - --parameter datadog-cluster-agent-image-tag="${DATADOG_CLUSTER_AGENT_IMAGE#*:}" \ - --parameter ci_commit_short_sha="${CI_COMMIT_SHORT_SHA:-unknown}" \ - --parameter ci_pipeline_id="${CI_PIPELINE_ID:-unknown}" \ - --parameter ci_job_id="${CI_JOB_ID:-unknown}" || : - ;; -esac - -# we are waiting for the end of the workflow but we don't care about its return code -exit 0 diff --git a/test/e2e/scripts/run-instance/23-argo-get.sh b/test/e2e/scripts/run-instance/23-argo-get.sh deleted file mode 100755 index 1c74939c56a94..0000000000000 --- a/test/e2e/scripts/run-instance/23-argo-get.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -set -euo pipefail - -printf '=%.0s' {0..79} ; echo - -ARGO_WORKFLOW=${ARGO_WORKFLOW:-''} - -cd "$(dirname "$0")" - -# Wait for any Running workflow -until [[ "$(./argo list --running -o name)" == "No workflows found" ]]; do - sleep 10 -done - -if [[ "$(./argo list -o name)" == "No workflows found" ]]; then - echo "No workflow found" - exit 1 -fi - -if ! locale -k LC_CTYPE | grep -qi 'charmap="utf-\+8"'; then - no_utf8_opt='--no-utf8' -fi - -for workflow in $(./argo list --status Succeeded -o name | grep -v 'No workflows found'); do - # CSPM always gets logs - if [ "$ARGO_WORKFLOW" = "cspm" ]; then - ./argo logs "$workflow" - fi - - ./argo get ${no_utf8_opt:-} "$workflow" -done - -EXIT_CODE=0 -for workflow in $(./argo list --status Failed -o name | grep -v 'No workflows found'); do - ./argo logs "$workflow" - ./argo get ${no_utf8_opt:-} "$workflow" - EXIT_CODE=2 -done - -# Make the Argo UI available from the user -kubectl --namespace argo patch service/argo-server --type json --patch $'[{"op": "replace", "path": "/spec/type", "value": "NodePort"}, {"op": "replace", "path": "/spec/ports", "value": [{"port": 2746, "nodePort": 30001, "targetPort": 2746}]}]' - -# In case of failure, let's keep the VM for 1 day instead of 2 hours for investigation -if [[ $EXIT_CODE != 0 ]]; then - sudo sed -i 's/^OnBootSec=.*/OnBootSec=86400/' /etc/systemd/system/terminate.timer - sudo systemctl daemon-reload - sudo systemctl restart terminate.timer -fi - -TIME_LEFT=$(systemctl status terminate.timer | awk '$1 == "Trigger:" {print gensub(/ *Trigger: (.*)/, "\\1", 1)}') -LOCAL_IP=$(curl -s http://169.254.169.254/2020-10-27/meta-data/local-ipv4) -BEGIN_TS=$(./argo list -o json | jq -r '.[] | .metadata.creationTimestamp' | while read -r ts; do date -d "$ts" +%s; done | sort -n | head -n 1) - -printf "\033[1mThe Argo UI will remain available at \033[1;34mhttps://%s\033[0m until \033[1;33m%s\033[0m.\n" "$LOCAL_IP" "$TIME_LEFT" -printf "\033[1mAll the logs of this job can be found at \033[1;34mhttps://dddev.datadoghq.com/logs?query=app%%3Aagent-e2e-tests%%20ci_commit_short_sha%%3A%s%%20ci_pipeline_id%%3A%s%%20ci_job_id%%3A%s&index=dd-agent-ci-e2e&from_ts=%d000&to_ts=%d000&live=false\033[0m.\n" "${CI_COMMIT_SHORT_SHA:-unknown}" "${CI_PIPELINE_ID:-unknown}" "${CI_JOB_ID:-unknown}" "$BEGIN_TS" "$(date +%s)" - -exit ${EXIT_CODE} diff --git a/test/e2e/scripts/run-instance/24-argo-to-ci-setup.sh b/test/e2e/scripts/run-instance/24-argo-to-ci-setup.sh deleted file mode 100755 index a971c9005a4ce..0000000000000 --- a/test/e2e/scripts/run-instance/24-argo-to-ci-setup.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -euo pipefail - -cd "$(dirname "$0")" - -docker build -t argo-to-junit-helper:local ./argo-to-junit \ No newline at end of file diff --git a/test/e2e/scripts/run-instance/25-argo-to-ci.sh b/test/e2e/scripts/run-instance/25-argo-to-ci.sh deleted file mode 100755 index 84512ab6a388a..0000000000000 --- a/test/e2e/scripts/run-instance/25-argo-to-ci.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -set -euo pipefail - -cd "$(dirname "$0")" - -if ! locale -k LC_CTYPE | grep -qi 'charmap="utf-\+8"'; then - no_utf8_opt='--no-utf8' -fi - -mkdir data - -for workflow in $(./argo list -o name | grep -v 'No workflows found'); do - JSON_CRD_FILE=data/$workflow.json - JUNIT_XML_FILE=data/$workflow-junit.xml - ./argo get ${no_utf8_opt:-} "$workflow" --output json > $JSON_CRD_FILE - docker run -v $PWD/data:/data:z argo-to-junit-helper:local /$JSON_CRD_FILE /$JUNIT_XML_FILE - DATADOG_API_KEY=$DD_API_KEY datadog-ci junit upload --service agent-e2e-tests $JUNIT_XML_FILE -done diff --git a/test/e2e/scripts/run-instance/argo-to-junit/Dockerfile b/test/e2e/scripts/run-instance/argo-to-junit/Dockerfile deleted file mode 100644 index 7f380f2a55eee..0000000000000 --- a/test/e2e/scripts/run-instance/argo-to-junit/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM gcr.io/google-containers/python:3.5.1-alpine - -COPY requirements.txt argo_to_junit.py entrypoint.sh / -RUN pip3 install -r requirements.txt - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/test/e2e/scripts/run-instance/argo-to-junit/argo_to_junit.py b/test/e2e/scripts/run-instance/argo-to-junit/argo_to_junit.py deleted file mode 100755 index 7e1d75c94517b..0000000000000 --- a/test/e2e/scripts/run-instance/argo-to-junit/argo_to_junit.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python3 - -import json -from argparse import ArgumentParser -from datetime import datetime - -from junit_xml import TestCase, TestSuite - - -def _str_to_datetime(date_str): - return datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%SZ') - - -def _generate_test_suites(root_name, argo_nodes): - """ - Groups argo nodes by parents, generate the test cases - and yields the corresponding test suites. - """ - for node_id, node_status in argo_nodes.items(): - if node_status.get("type") in ["StepGroup", "DAG"]: - test_cases = [] - tc = TestCase(node_status.get("displayName", node_id)) - children = node_status.get("children", []) - for child_id in children: - child_status = argo_nodes.get(child_id, None) - if not child_status or child_status.get("type") != "Pod": - continue - children.extend(child_status.get("children", [])) - end = _str_to_datetime(child_status.get("finishedAt")) - start = _str_to_datetime(child_status.get("startedAt")) - job_duration = (end - start).total_seconds() - tc = TestCase(child_status.get("displayName"), elapsed_sec=job_duration) - if child_status.get("phase") == "Failed": - tc.add_failure_info(child_status.get("message")) - test_cases.append(tc) - if len(test_cases) == 0: - continue - parent_name = argo_nodes.get(node_status.get("boundaryID")).get("displayName") - # Some steps are tied directly to the root workflow (i.e the parent is argo-datadog-agent-*) - # Thus, we use a deterministic format to generate the test suite name in that case. - ts_name = parent_name if parent_name != root_name else "root" + "/" + node_status.get("displayName") - yield TestSuite(ts_name, test_cases) - - -def main(): - parser = ArgumentParser() - parser.add_argument("-i", "--input-file", help="File containing the Argo CRD in JSON", required=True) - parser.add_argument("-o", "--output-file", default="junit.xml", help="The junit xml file") - args = parser.parse_args() - - with open(args.input_file) as f: - crd = json.loads(f.read()) - crd_name = crd.get("metadata", {}).get("name") - nodes = crd.get("status", {}).get("nodes") - if not crd_name or not nodes: - print(json.dumps(crd)) - raise Exception("Incompatible CRD") - - test_suites = [] - for ts in _generate_test_suites(crd_name, nodes): - test_suites.append(ts) - with open(args.output_file, "w") as f: - TestSuite.to_file(f, test_suites) - - -if __name__ == "__main__": - main() diff --git a/test/e2e/scripts/run-instance/argo-to-junit/entrypoint.sh b/test/e2e/scripts/run-instance/argo-to-junit/entrypoint.sh deleted file mode 100755 index 72f1650ada344..0000000000000 --- a/test/e2e/scripts/run-instance/argo-to-junit/entrypoint.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -set -e - -if [ "$#" -ne 2 ]; then - /argo_to_junit.py --help - exit 1 -fi - -/argo_to_junit.py --input-file $1 --output-file $2 diff --git a/test/e2e/scripts/run-instance/argo-to-junit/requirements.txt b/test/e2e/scripts/run-instance/argo-to-junit/requirements.txt deleted file mode 100644 index 37ea29569761f..0000000000000 --- a/test/e2e/scripts/run-instance/argo-to-junit/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -junit-xml==1.9 diff --git a/test/e2e/scripts/run-instance/argo.amd64.sha256sum b/test/e2e/scripts/run-instance/argo.amd64.sha256sum deleted file mode 100644 index de69f0053c844..0000000000000 --- a/test/e2e/scripts/run-instance/argo.amd64.sha256sum +++ /dev/null @@ -1 +0,0 @@ -834a1cc0972a8810dfc39469b176d4dead17b0bc29968974da52d89b59357ac2 argo.gz \ No newline at end of file diff --git a/test/e2e/scripts/run-instance/argo.arm64.sha256sum b/test/e2e/scripts/run-instance/argo.arm64.sha256sum deleted file mode 100644 index ed3d0797a7dfd..0000000000000 --- a/test/e2e/scripts/run-instance/argo.arm64.sha256sum +++ /dev/null @@ -1 +0,0 @@ -e54086fd80f2e5de1c4ea9e7b935565b4404233ea4c96264055a7e16e85c376c argo.gz \ No newline at end of file diff --git a/test/e2e/scripts/run-instance/kind-cluster.yaml b/test/e2e/scripts/run-instance/kind-cluster.yaml deleted file mode 100644 index 4a8aed1991464..0000000000000 --- a/test/e2e/scripts/run-instance/kind-cluster.yaml +++ /dev/null @@ -1,18 +0,0 @@ -kind: Cluster -apiVersion: kind.x-k8s.io/v1alpha4 -nodes: -- role: control-plane - extraMounts: - - containerPath: /var/lib/kubelet/config.json - hostPath: /root/.docker/config.json - - containerPath: /host/datadog-agent - hostPath: /home/core/datadog-agent - - containerPath: /host/proc - hostPath: /proc - extraPortMappings: - - containerPort: 30001 - hostPort: 443 -containerdConfigPatches: - - |- - [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] - endpoint = ["https://mirror.gcr.io", "https://registry-1.docker.io"] diff --git a/test/e2e/scripts/setup-instance/.gitignore b/test/e2e/scripts/setup-instance/.gitignore deleted file mode 100644 index 680a4486820dd..0000000000000 --- a/test/e2e/scripts/setup-instance/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -fcct-* -kind -kubectl -kubectl.sha256 -fedora.gpg -butane-* diff --git a/test/e2e/scripts/setup-instance/00-entrypoint-dev.sh b/test/e2e/scripts/setup-instance/00-entrypoint-dev.sh deleted file mode 100755 index bf1c60c084704..0000000000000 --- a/test/e2e/scripts/setup-instance/00-entrypoint-dev.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -printf '=%.0s' {0..79} ; echo - -BASE64_FLAGS="-w 0" -# OSX with 2 types of base64 binary in PATH ... -if [[ $(uname) == "Darwin" ]] -then - echo "Currently running over Darwin" - # shellcheck disable=SC2086 - echo "osx base64" | base64 ${BASE64_FLAGS} || { - echo "current base64 binary does not support ${BASE64_FLAGS}" - BASE64_FLAGS="" - } -fi - -set -e - -cd "$(dirname "$0")" - -git clean -fdx . - -# Generate ssh-key and ignition files -./01-ignition.sh -# shellcheck disable=SC2086 -IGNITION_BASE64=$(base64 ${BASE64_FLAGS} ignition.json) - -REGION="${REGION:-us-east-1}" -UPDATE_STREAM="${UPDATE_STREAM:-stable}" -AMI="$(curl "https://builds.coreos.fedoraproject.org/streams/${UPDATE_STREAM}.json" | jq -r ".architectures.x86_64.images.aws.regions.\"$REGION\".image")" - -tee specification.json << EOF -{ - "ImageId": "${AMI}", - "InstanceType": "t3.2xlarge", - "Monitoring": { - "Enabled": false - }, - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/xvda", - "Ebs": { - "DeleteOnTermination": true, - "VolumeSize": 50, - "VolumeType": "gp2" - } - } - ], - "UserData": "${IGNITION_BASE64}", - - "SubnetId": "subnet-b89e00e2", - "SecurityGroupIds": ["sg-7fedd80a"] -} -EOF - -export CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA:-$(git describe --tags --always --dirty --match 7.\*)} - -exec ./02-ec2.sh diff --git a/test/e2e/scripts/setup-instance/00-entrypoint-gitlab.sh b/test/e2e/scripts/setup-instance/00-entrypoint-gitlab.sh deleted file mode 100755 index 7279be3fabb27..0000000000000 --- a/test/e2e/scripts/setup-instance/00-entrypoint-gitlab.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -printf '=%.0s' {0..79} ; echo - -cd "$(dirname "$0")" - -git clean -fdx . - -# Generate ssh-key and ignition files -./01-ignition.sh -IGNITION_BASE64=$(base64 -w 0 ignition.json) - -REGION="${REGION:-us-east-1}" -UPDATE_STREAM="${UPDATE_STREAM:-stable}" -if [ -z "${AMI+x}" ]; then - AMI="$(curl "https://builds.coreos.fedoraproject.org/streams/${UPDATE_STREAM}.json" | jq -r ".architectures.x86_64.images.aws.regions.\"$REGION\".image")" -fi -ARGO_WORKFLOW=${ARGO_WORKFLOW:-''} - -# TODO remove the IamInstanceProfile -tee specification.json << EOF -{ - "ImageId": "${AMI}", - "InstanceType": "t3.2xlarge", - "Monitoring": { - "Enabled": false - }, - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/xvda", - "Ebs": { - "DeleteOnTermination": true, - "VolumeSize": 50, - "VolumeType": "gp2" - } - } - ], - "UserData": "${IGNITION_BASE64}", - - "SubnetId": "subnet-05d7c6b1b5cfea811", - "IamInstanceProfile": { - "Name": "ci-datadog-agent-e2e-runner" - }, - "SecurityGroupIds": ["sg-019917348cb0eb7e7"] -} -EOF - -echo "Running inside a gitlab pipeline," -echo "using DATADOG_AGENT_IMAGE=${DATADOG_AGENT_IMAGE}" -echo "using DATADOG_CLUSTER_AGENT_IMAGE=${DATADOG_CLUSTER_AGENT_IMAGE}" -echo "using ARGO_WORKFLOW=${ARGO_WORKFLOW}" - -# Check if the image is hosted on a docker registry and if it's available -echo "${DATADOG_AGENT_IMAGE} is hosted on a docker registry, checking if it's available" -IMAGE_REPOSITORY=${DATADOG_AGENT_IMAGE%:*} -IMAGE_TAG=${DATADOG_AGENT_IMAGE#*:} -if ! curl -Lfs --head "https://hub.docker.com/v2/repositories/${IMAGE_REPOSITORY}/tags/${IMAGE_TAG}" > /dev/null ; then - echo "The DATADOG_AGENT_IMAGE=${DATADOG_AGENT_IMAGE} is not available on DockerHub" - echo "Ensure that the manual jobs in dev_container_deploy has been run/rerun" - echo "*dev_branch* -> k8s-e2e-*-dev" - echo "*dev_master* -> k8s-e2e-*-main" - exit 2 -fi - -echo "${DATADOG_CLUSTER_AGENT_IMAGE} is hosted on a docker registry, checking if it's available" -IMAGE_REPOSITORY=${DATADOG_CLUSTER_AGENT_IMAGE%:*} -IMAGE_TAG=${DATADOG_CLUSTER_AGENT_IMAGE#*:} -if ! curl -Lfs --head "https://hub.docker.com/v2/repositories/${IMAGE_REPOSITORY}/tags/${IMAGE_TAG}" > /dev/null ; then - echo "The DATADOG_CLUSTER_AGENT_IMAGE=${DATADOG_CLUSTER_AGENT_IMAGE} is not available on DockerHub" - echo "Ensure that the manual jobs in dev_container_deploy has been run/rerun" - echo "*dev_branch* -> k8s-e2e-*-dev" - echo "*dev_master* -> k8s-e2e-*-main" - exit 2 -fi - -exec ./02-ec2.sh diff --git a/test/e2e/scripts/setup-instance/00-entrypoint-local.sh b/test/e2e/scripts/setup-instance/00-entrypoint-local.sh deleted file mode 100755 index 6bf51fd15970b..0000000000000 --- a/test/e2e/scripts/setup-instance/00-entrypoint-local.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -printf '=%.0s' {0..79} ; echo -set -e -cd "$(dirname "$0")" - -../run-instance/10-setup-kind.sh -../run-instance/11-setup-kind-cluster.sh -../run-instance/20-argo-download.sh -../run-instance/21-argo-setup.sh -../run-instance/22-argo-submit.sh -../run-instance/23-argo-get.sh diff --git a/test/e2e/scripts/setup-instance/01-ignition.sh b/test/e2e/scripts/setup-instance/01-ignition.sh deleted file mode 100755 index 870d85ddeb4b7..0000000000000 --- a/test/e2e/scripts/setup-instance/01-ignition.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -printf '=%.0s' {0..79} ; echo - -cd "$(dirname "$0")" -ssh-keygen -b 4096 -t rsa -C "datadog" -N "" -f "id_rsa" -SSH_RSA=$(cat id_rsa.pub) - -arch=$(uname -m) -if [ "$arch" = "arm64" ]; -then - arch="aarch64" -fi - -case "$(uname)" in - Linux) butane="butane-$arch-unknown-linux-gnu";; - Darwin) butane="butane-$arch-apple-darwin";; -esac - -curl -O "https://fedoraproject.org/fedora.gpg" -curl -LOC - "https://github.com/coreos/butane/releases/download/v0.20.0/${butane}" -curl -LO "https://github.com/coreos/butane/releases/download/v0.20.0/${butane}.asc" - -gpgv --keyring ./fedora.gpg "${butane}.asc" "$butane" -chmod +x "$butane" - -"./$butane" --pretty --strict < -generate_namespace() -{ - # Generate unique namespace from workflow_group and workflow - # namespace format: --- - echo 'Info: Generating namespace...' - PREFIX=$1-$2 - # `_` and `.` are not allowed in namespace names, replace them with `-` - PREFIX=${PREFIX//[_.]/-} - CHECK_SUM=$(echo -n "$PREFIX" | md5sum | cut -c1-15) - NAMESPACE=$PREFIX-$CHECK_SUM - if ! [[ $NAMESPACE =~ ^[0-9a-zA-Z-]+$ ]]; then - echo "Error: Invalid namespace format: $NAMESPACE" - exit 1 - fi - echo "Info: Generated namespace: $NAMESPACE" -} - -# Usage: check_yq_installed -check_yq_installed() -{ - if ! [ -x "$(command -v yq)" ]; then - echo 'Error: yq is not installed.' - exit 1 - fi -} \ No newline at end of file diff --git a/test/new-e2e/tests/containers/k8s_test.go b/test/new-e2e/tests/containers/k8s_test.go index af2f9917a2f9e..2badd72b23401 100644 --- a/test/new-e2e/tests/containers/k8s_test.go +++ b/test/new-e2e/tests/containers/k8s_test.go @@ -929,8 +929,16 @@ func (suite *k8sSuite) testAdmissionControllerPod(namespace string, name string, }, 5*time.Minute, 10*time.Second, "The deployment with name %s in namespace %s does not exist or does not have the auto detected languages annotation", name, namespace) } + // Record old pod, so we can be sure we are not looking at the incorrect one after deletion + oldPods, err := suite.K8sClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", name).String(), + }) + suite.Require().NoError(err) + suite.Require().Len(oldPods.Items, 1) + oldPod := oldPods.Items[0] + // Delete the pod to ensure it is recreated after the admission controller is deployed - err := suite.K8sClient.CoreV1().Pods(namespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{ + err = suite.K8sClient.CoreV1().Pods(namespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("app", name).String(), }) suite.Require().NoError(err) @@ -948,6 +956,9 @@ func (suite *k8sSuite) testAdmissionControllerPod(namespace string, name string, return } pod = pods.Items[0] + if !assert.NotEqual(c, oldPod.Name, pod.Name) { + return + } }, 2*time.Minute, 10*time.Second, "Failed to witness the creation of pod with name %s in namespace %s", name, namespace) suite.Require().Len(pod.Spec.Containers, 1) diff --git a/test/new-e2e/tests/cspm/cspm_test.go b/test/new-e2e/tests/cspm/cspm_test.go new file mode 100644 index 0000000000000..2c7a03f8b67b1 --- /dev/null +++ b/test/new-e2e/tests/cspm/cspm_test.go @@ -0,0 +1,303 @@ +// Unless explicitly stated otherwise all files in this repository are licensed +// under the Apache License Version 2.0. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2016-present Datadog, Inc. + +// Package cspm contains the e2e tests for cspm +package cspm + +import ( + "context" + _ "embed" + "encoding/json" + "fmt" + "slices" + "testing" + "time" + + "k8s.io/apimachinery/pkg/fields" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" +) + +type cspmTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +type findings = map[string][]map[string]string + +var expectedFindingsMasterEtcdNode = findings{ + "cis-kubernetes-1.5.1-1.1.12": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.16": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.19": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.21": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.22": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.23": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.24": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.25": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.26": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.33": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.2.6": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.3.2": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.3.3": []map[string]string{ + { + "result": "passed", + }, + }, + "cis-kubernetes-1.5.1-1.3.4": []map[string]string{ + { + "result": "passed", + }, + }, + "cis-kubernetes-1.5.1-1.3.5": []map[string]string{ + { + "result": "passed", + }, + }, + "cis-kubernetes-1.5.1-1.3.6": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-1.3.7": []map[string]string{ + { + "result": "passed", + }, + }, + "cis-kubernetes-1.5.1-1.4.1": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-3.2.1": []map[string]string{ + { + "result": "failed", + }, + }, +} +var expectedFindingsWorkerNode = findings{ + "cis-kubernetes-1.5.1-4.2.1": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-4.2.3": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-4.2.4": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-4.2.5": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-4.2.6": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-4.2.10": []map[string]string{ + { + "result": "failed", + }, + }, + "cis-kubernetes-1.5.1-4.2.12": []map[string]string{ + { + "result": "failed", + }, + }, +} + +//go:embed values.yaml +var values string + +func TestCSPM(t *testing.T) { + e2e.Run(t, &cspmTestSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner(awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(values), kubernetesagentparams.WithoutDualShipping())))) +} + +func (s *cspmTestSuite) TestFindings() { + res, err := s.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(context.Background(), metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", s.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), + }) + require.NoError(s.T(), err) + require.Len(s.T(), res.Items, 1) + agentPod := res.Items[0] + _, _, err = s.Env().KubernetesCluster.KubernetesClient.PodExec("datadog", agentPod.Name, "security-agent", []string{"security-agent", "compliance", "check", "--dump-reports", "/tmp/reports", "--report"}) + require.NoError(s.T(), err) + dumpContent, _, err := s.Env().KubernetesCluster.KubernetesClient.PodExec("datadog", agentPod.Name, "security-agent", []string{"cat", "/tmp/reports"}) + require.NoError(s.T(), err) + findings, err := parseFindingOutput(dumpContent) + require.NoError(s.T(), err) + s.checkFindings(findings, mergeFindings(expectedFindingsMasterEtcdNode, expectedFindingsWorkerNode)) +} + +func (s *cspmTestSuite) TestMetrics() { + s.T().Log("Waiting for datadog.security_agent.compliance.running metrics") + assert.EventuallyWithT(s.T(), func(c *assert.CollectT) { + + metrics, err := s.Env().FakeIntake.Client().FilterMetrics("datadog.security_agent.compliance.running") + if !assert.NoError(c, err) { + return + } + if assert.NotEmpty(c, metrics) { + s.T().Log("Metrics found: datadog.security_agent.compliance.running") + } + }, 2*time.Minute, 10*time.Second) + + s.T().Log("Waiting for datadog.security_agent.compliance.containers_running metrics") + assert.EventuallyWithT(s.T(), func(c *assert.CollectT) { + metrics, err := s.Env().FakeIntake.Client().FilterMetrics("datadog.security_agent.compliance.containers_running") + if !assert.NoError(c, err) { + return + } + if assert.NotEmpty(c, metrics) { + s.T().Log("Metrics found: datadog.security_agent.compliance.containers_running") + } + }, 2*time.Minute, 10*time.Second) + +} +func (s *cspmTestSuite) checkFindings(findings, expectedFindings findings) { + s.T().Helper() + checkedRule := []string{} + for expectedRule, expectedRuleFindinds := range expectedFindings { + assert.Contains(s.T(), findings, expectedRule) + for _, expectedFinding := range expectedRuleFindinds { + found := false + for _, finding := range findings[expectedRule] { + if isSubset(expectedFinding, finding) { + found = true + break + } + } + assert.Truef(s.T(), found, "unexpected finding %v for rule %s", findings[expectedRule], expectedRule) + checkedRule = append(checkedRule, expectedRule) + } + } + for rule, ruleFindings := range findings { + if slices.Contains(checkedRule, rule) { + continue + } + for _, ruleFinding := range ruleFindings { + fmt.Printf("rule %s finding %v\n", rule, ruleFinding["result"]) + } + } + for rule, ruleFindings := range findings { + if slices.Contains(checkedRule, rule) { + continue + } + for _, ruleFinding := range ruleFindings { + assert.NotContains(s.T(), []string{"failed", "error"}, ruleFinding["result"], fmt.Sprintf("finding for rule %s not expected to be in failed or error state", rule)) + } + } + +} + +func isSubset(a, b map[string]string) bool { + for k, v := range a { + if vb, found := b[k]; !found || vb != v { + return false + } + } + return true +} + +func mergeFindings(a, b findings) findings { + for k, v := range b { + a[k] = v + } + return a +} + +func parseFindingOutput(output string) (findings, error) { + + result := map[string]any{} + parsedResult := findings{} + err := json.Unmarshal([]byte(output), &result) + if err != nil { + return nil, err + } + for rule, ruleFindings := range result { + ruleFindingsCasted, ok := ruleFindings.([]any) + if !ok { + return nil, fmt.Errorf("failed to parse output: %s for rule %s cannot be casted into []any", ruleFindings, rule) + } + parsedRuleFinding := []map[string]string{} + for _, finding := range ruleFindingsCasted { + findingCasted, ok := finding.(map[string]any) + if !ok { + return nil, fmt.Errorf("failed to parse output: %s for rule %s cannot be casted into map[string]any", finding, rule) + } + parsedFinding := map[string]string{} + for k, v := range findingCasted { + if _, ok := v.(string); ok { + parsedFinding[k] = v.(string) + } + } + parsedRuleFinding = append(parsedRuleFinding, parsedFinding) + + } + parsedResult[rule] = parsedRuleFinding + + } + return parsedResult, nil +} diff --git a/test/new-e2e/tests/cspm/values.yaml b/test/new-e2e/tests/cspm/values.yaml new file mode 100644 index 0000000000000..4a9aff86ca347 --- /dev/null +++ b/test/new-e2e/tests/cspm/values.yaml @@ -0,0 +1,4 @@ +datadog: + securityAgent: + compliance: + enabled: true diff --git a/test/otel/go.mod b/test/otel/go.mod index 4e012080206ec..4088b0e848bff 100644 --- a/test/otel/go.mod +++ b/test/otel/go.mod @@ -37,6 +37,7 @@ replace ( github.com/DataDog/datadog-agent/pkg/config/mock => ./../../pkg/config/mock github.com/DataDog/datadog-agent/pkg/config/model => ./../../pkg/config/model 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/utils => ./../../pkg/config/utils github.com/DataDog/datadog-agent/pkg/logs/auditor => ./../../pkg/logs/auditor github.com/DataDog/datadog-agent/pkg/logs/client => ./../../pkg/logs/client @@ -98,8 +99,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.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/config/setup 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/proto v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 ) @@ -108,7 +109,7 @@ require ( github.com/DataDog/agent-payload/v5 v5.0.119 // 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.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/secrets v0.57.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.56.0-rc.3 // indirect @@ -121,9 +122,10 @@ require ( 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/aggregator/ckey 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/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/structure v0.0.0-00010101000000-000000000000 // 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 @@ -151,22 +153,22 @@ 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.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/executable v0.57.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.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/hostname/validate v0.57.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.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/log 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.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.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/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.0 // indirect github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.26.0 // indirect github.com/DataDog/datadog-go/v5 v5.5.0 // indirect