Skip to content

Commit

Permalink
Merge branch 'main' into adelhajhassan/exclude_syncing_pods_in_clc_ta…
Browse files Browse the repository at this point in the history
…gger
  • Loading branch information
adel121 authored Oct 10, 2024
2 parents c0cea6a + d51e114 commit 1aca267
Show file tree
Hide file tree
Showing 124 changed files with 1,801 additions and 516 deletions.
7 changes: 7 additions & 0 deletions .ddqa/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,10 @@ jira_issue_type = "Task"
jira_statuses = ["To Do", "In Progress", "Done"]
github_team = "agent-release-management"
github_labels = ["team/agent-release-management"]

[teams."Dynamic Instrumentation"]
jira_project = "DEBUG"
jira_issue_type = "Task"
jira_statuses = ["To Do", "In Progress", "Done"]
github_team = "debugger-go"
github_labels = ["team/dynamic-instrumentation"]
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ workflow:
- pkg/network/**/*
- pkg/process/monitor/*
- pkg/util/kernel/**/*
- pkg/dynamicinstrumentation/**/*
- pkg/gpu/**/*
- .gitlab/kernel_matrix_testing/system_probe.yml
- .gitlab/kernel_matrix_testing/common.yml
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/.pre/gitlab_configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ lint_gitlab_ci_jobs_codeowners:
rules:
- !reference [.on_gitlab_changes]
script:
- inv -e linter.gitlab-ci-jobs-codeowners
- inv -e linter.gitlab-ci-jobs-codeowners --all-files
2 changes: 1 addition & 1 deletion .gitlab/source_test/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
-e CI_JOB_NAME="${CI_JOB_NAME}"
-e CI_JOB_ID="${CI_JOB_ID}"
-e CI_PIPELINE_ID="${CI_PIPELINE_ID}"
-e CI_PIPELINE_SOURCE="${CI_PIPELINE_SOURCE}"
-e CI_REPOSITORY_URL="${CI_REPOSITORY_URL}"
-e CI_COMMIT_SHA="${CI_COMMIT_SHA}"
-e CI_PROJECT_NAME="${CI_PROJECT_NAME}"
Expand All @@ -43,7 +44,6 @@
-e CODECOV_TOKEN="${CODECOV_TOKEN}"
-e S3_PERMANENT_ARTIFACTS_URI="${S3_PERMANENT_ARTIFACTS_URI}"
-e COVERAGE_CACHE_FLAG="${COVERAGE_CACHE_FLAG}"
-e GITLAB_TOKEN="${GITLAB_READ_API_TOKEN}"
486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/windows_1809_${ARCH}${Env:DATADOG_AGENT_WINBUILDIMAGES_SUFFIX}:${Env:DATADOG_AGENT_WINBUILDIMAGES}
c:\mnt\tasks\winbuildscripts\unittests.bat
- If ($lastExitCode -ne "0") { throw "Previous command returned $lastExitCode" }
Expand Down
8 changes: 4 additions & 4 deletions cmd/agent/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"net/http"
"path/filepath"

"github.com/DataDog/datadog-agent/cmd/agent/common/path"
"github.com/DataDog/datadog-agent/pkg/api/util"
"github.com/DataDog/datadog-agent/pkg/config/settings"
settingshttp "github.com/DataDog/datadog-agent/pkg/config/settings/http"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/version"
)

Expand All @@ -26,9 +26,9 @@ import (
func GetPythonPaths() []string {
// wheels install in default site - already in sys.path; takes precedence over any additional location
return []string{
path.GetDistPath(), // common modules are shipped in the dist path directly or under the "checks/" sub-dir
path.PyChecksPath, // integrations-core legacy checks
filepath.Join(path.GetDistPath(), "checks.d"), // custom checks in the "checks.d/" sub-dir of the dist path
defaultpaths.GetDistPath(), // common modules are shipped in the dist path directly or under the "checks/" sub-dir
defaultpaths.PyChecksPath, // integrations-core legacy checks
filepath.Join(defaultpaths.GetDistPath(), "checks.d"), // custom checks in the "checks.d/" sub-dir of the dist path
pkgconfigsetup.Datadog().GetString("additional_checksd"), // custom checks, least precedent check location
}
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/agent/common/common_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"os"
"path/filepath"

"github.com/DataDog/datadog-agent/cmd/agent/common/path"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/util/log"
"github.com/DataDog/datadog-agent/pkg/util/winutil"
"github.com/DataDog/datadog-agent/pkg/util/winutil/messagestrings"
Expand All @@ -24,7 +24,7 @@ const ServiceName = "DatadogAgent"
func init() {
_, err := winutil.GetProgramDataDir()
if err != nil {
winutil.LogEventViewer(ServiceName, messagestrings.MSG_WARNING_PROGRAMDATA_ERROR, path.DefaultConfPath)
winutil.LogEventViewer(ServiceName, messagestrings.MSG_WARNING_PROGRAMDATA_ERROR, defaultpaths.ConfPath)
}
}

Expand All @@ -43,12 +43,12 @@ func EnableLoggingToFile() {
// CheckAndUpgradeConfig checks to see if there's an old datadog.conf, and if
// datadog.yaml is either missing or incomplete (no API key). If so, upgrade it
func CheckAndUpgradeConfig() error {
datadogConfPath := filepath.Join(path.DefaultConfPath, "datadog.conf")
datadogConfPath := filepath.Join(defaultpaths.ConfPath, "datadog.conf")
if _, err := os.Stat(datadogConfPath); os.IsNotExist(err) {
log.Debug("Previous config file not found, not upgrading")
return nil
}
pkgconfigsetup.Datadog().AddConfigPath(path.DefaultConfPath)
pkgconfigsetup.Datadog().AddConfigPath(defaultpaths.ConfPath)
_, err := pkgconfigsetup.LoadWithoutSecret(pkgconfigsetup.Datadog(), nil)
if err == nil {
// was able to read config, check for api key
Expand All @@ -57,7 +57,7 @@ func CheckAndUpgradeConfig() error {
return nil
}
}
err = ImportConfig(path.DefaultConfPath, path.DefaultConfPath, false)
err = ImportConfig(defaultpaths.ConfPath, defaultpaths.ConfPath, false)
if err != nil {
winutil.LogEventViewer(ServiceName, messagestrings.MSG_WARN_CONFIGUPGRADE_FAILED, err.Error())
return err
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/common/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"fmt"
"path/filepath"

"github.com/DataDog/datadog-agent/cmd/agent/common/path"
"github.com/DataDog/datadog-agent/comp/core/autodiscovery"
"github.com/DataDog/datadog-agent/comp/core/config"
"github.com/DataDog/datadog-agent/comp/core/secrets"
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
"github.com/DataDog/datadog-agent/pkg/sbom/scanner"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/util/optional"
)

Expand All @@ -41,7 +41,7 @@ func GetWorkloadmetaInit() workloadmeta.InitHelper {
func LoadComponents(_ secrets.Component, wmeta workloadmeta.Component, ac autodiscovery.Component, confdPath string) {
confSearchPaths := []string{
confdPath,
filepath.Join(path.GetDistPath(), "conf.d"),
filepath.Join(defaultpaths.GetDistPath(), "conf.d"),
"",
}

Expand Down
45 changes: 0 additions & 45 deletions cmd/agent/common/path/path_darwin.go

This file was deleted.

45 changes: 0 additions & 45 deletions cmd/agent/common/path/path_freebsd.go

This file was deleted.

47 changes: 0 additions & 47 deletions cmd/agent/common/path/path_nix.go

This file was deleted.

4 changes: 2 additions & 2 deletions cmd/agent/common/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"runtime"
"strings"

"github.com/DataDog/datadog-agent/cmd/agent/common/path"
"github.com/DataDog/datadog-agent/comp/core/secrets"
"github.com/DataDog/datadog-agent/pkg/config/model"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/util/optional"
)

Expand All @@ -35,7 +35,7 @@ func SetupConfigForTest(confFilePath string) (*model.Warnings, error) {
cfg.SetConfigFile(confFilePath)
}
}
cfg.AddConfigPath(path.DefaultConfPath)
cfg.AddConfigPath(defaultpaths.ConfPath)
// load the configuration
warnings, err := pkgconfigsetup.LoadDatadogCustom(cfg, origin, optional.NewNoneOption[secrets.Component](), nil)
if err != nil {
Expand Down
19 changes: 9 additions & 10 deletions cmd/agent/subcommands/flare/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import (
"github.com/DataDog/datadog-agent/cmd/agent/command"
"github.com/DataDog/datadog-agent/cmd/agent/common"
"github.com/DataDog/datadog-agent/cmd/agent/subcommands/streamlogs"

commonpath "github.com/DataDog/datadog-agent/cmd/agent/common/path"
"github.com/DataDog/datadog-agent/comp/aggregator/diagnosesendermanager/diagnosesendermanagerimpl"
authtokenimpl "github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl"
"github.com/DataDog/datadog-agent/comp/collector/collector"
Expand Down Expand Up @@ -53,6 +51,7 @@ import (
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/process/net"
"github.com/DataDog/datadog-agent/pkg/serializer"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"github.com/DataDog/datadog-agent/pkg/util/input"
"github.com/DataDog/datadog-agent/pkg/util/optional"
Expand Down Expand Up @@ -92,7 +91,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
cliParams.args = args
config := config.NewAgentParams(globalParams.ConfFilePath,
config.WithSecurityAgentConfigFilePaths([]string{
path.Join(commonpath.DefaultConfPath, "security-agent.yaml"),
path.Join(defaultpaths.ConfPath, "security-agent.yaml"),
}),
config.WithConfigLoadSecurityAgent(true),
config.WithIgnoreErrors(true),
Expand All @@ -109,12 +108,12 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
LogParams: log.ForOneShot(command.LoggerName, "off", false),
}),
flare.Module(flare.NewLocalParams(
commonpath.GetDistPath(),
commonpath.PyChecksPath,
commonpath.DefaultLogFile,
commonpath.DefaultJmxLogFile,
commonpath.DefaultDogstatsDLogFile,
commonpath.DefaultStreamlogsLogFile,
defaultpaths.GetDistPath(),
defaultpaths.PyChecksPath,
defaultpaths.LogFile,
defaultpaths.JmxLogFile,
defaultpaths.DogstatsDLogFile,
defaultpaths.StreamlogsLogFile,
)),
// workloadmeta setup
wmcatalog.GetCatalog(),
Expand Down Expand Up @@ -285,7 +284,7 @@ func makeFlare(flareComp flare.Component,
)

streamLogParams := streamlogs.CliParams{
FilePath: commonpath.DefaultStreamlogsLogFile,
FilePath: defaultpaths.StreamlogsLogFile,
Duration: cliParams.withStreamLogs,
Quiet: true,
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/subcommands/jmx/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (

"github.com/DataDog/datadog-agent/cmd/agent/command"
"github.com/DataDog/datadog-agent/cmd/agent/common"
"github.com/DataDog/datadog-agent/cmd/agent/common/path"
"github.com/DataDog/datadog-agent/comp/agent"
"github.com/DataDog/datadog-agent/comp/agent/jmxlogger"
"github.com/DataDog/datadog-agent/comp/agent/jmxlogger/jmxloggerimpl"
Expand Down Expand Up @@ -59,6 +58,7 @@ import (
"github.com/DataDog/datadog-agent/pkg/cli/standalone"
pkgcollector "github.com/DataDog/datadog-agent/pkg/collector"
"github.com/DataDog/datadog-agent/pkg/config/model"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
"github.com/DataDog/datadog-agent/pkg/util/optional"
)
Expand Down Expand Up @@ -107,7 +107,7 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command {
if cliParams.saveFlare {
// Windows cannot accept ":" in file names
filenameSafeTimeStamp := strings.ReplaceAll(time.Now().UTC().Format(time.RFC3339), ":", "-")
cliParams.logFile = filepath.Join(path.DefaultJMXFlareDirectory, "jmx_"+cliParams.command+"_"+filenameSafeTimeStamp+".log")
cliParams.logFile = filepath.Join(defaultpaths.JMXFlareDirectory, "jmx_"+cliParams.command+"_"+filenameSafeTimeStamp+".log")
cliParams.jmxLogLevel = "debug"
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/subcommands/jmx/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/stretchr/testify/require"

"github.com/DataDog/datadog-agent/cmd/agent/command"
"github.com/DataDog/datadog-agent/cmd/agent/common/path"
"github.com/DataDog/datadog-agent/comp/core"
"github.com/DataDog/datadog-agent/comp/core/secrets"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
)

Expand Down Expand Up @@ -64,7 +64,7 @@ func TestCollectCommand(t *testing.T) {
require.Equal(t, "collect", cliParams.command)
require.Equal(t, "debug", cliParams.jmxLogLevel) // overrides --log-level
require.Equal(t, "debug", coreParams.LogLevelFn(nil)) // overrides --log-level
require.True(t, strings.HasPrefix(cliParams.logFile, path.DefaultJMXFlareDirectory))
require.True(t, strings.HasPrefix(cliParams.logFile, defaultpaths.JMXFlareDirectory))
require.Equal(t, cliParams.logFile, coreParams.LogFileFn(nil))
require.Equal(t, "CORE", coreParams.LoggerName())
require.Equal(t, true, secretParams.Enabled)
Expand Down
Loading

0 comments on commit 1aca267

Please sign in to comment.