Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports_files(glob(
# gazelle:proto disable

# TODO(agent-build): remove below `gazelle:exclude` directives (automatically updates @bazelify_go_work//:go.work)
# gazelle:exclude cmd
# gazelle:exclude comp/agent
# gazelle:exclude comp/aggregator
# gazelle:exclude comp/api/api/utils
# gazelle:exclude comp/api/authtoken
Expand Down
19 changes: 19 additions & 0 deletions cmd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# gazelle:exclude agent
# gazelle:exclude cluster-agent
# gazelle:exclude cluster-agent-cloudfoundry
# gazelle:exclude dogstatsd
# gazelle:exclude host-profiler
# gazelle:exclude installer
# gazelle:exclude internal
# gazelle:exclude iot-agent
# gazelle:exclude loader
# gazelle:exclude otel-agent
# gazelle:exclude privateactionrunner
# gazelle:exclude process-agent
# gazelle:exclude sbomgen
# gazelle:exclude secrethelper
# gazelle:exclude security-agent
# gazelle:exclude serverless-init
# gazelle:exclude systray
# gazelle:exclude testdata
# gazelle:exclude trace-agent
22 changes: 22 additions & 0 deletions cmd/config-stream-client/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
load("@rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "config-stream-client_lib",
srcs = ["main.go"],
importpath = "github.com/DataDog/datadog-agent/cmd/config-stream-client",
visibility = ["//visibility:private"],
deps = [
"//pkg/proto/pbgo/core",
"//pkg/util/grpc",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//credentials",
"@org_golang_google_grpc//metadata",
"@org_golang_google_protobuf//types/known/structpb",
],
)

go_binary(
name = "config-stream-client",
embed = [":config-stream-client_lib"],
visibility = ["//visibility:public"],
)
31 changes: 30 additions & 1 deletion cmd/cws-instrumentation/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
# gazelle:ignore
load("@rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
name = "cws-instrumentation_lib",
srcs = [
"main_linux.go",
"main_windows.go",
],
importpath = "github.com/DataDog/datadog-agent/cmd/cws-instrumentation",
visibility = ["//visibility:private"],
deps = select({
"@rules_go//go/platform:android": [
"//cmd/cws-instrumentation/command",
"//cmd/cws-instrumentation/subcommands",
],
"@rules_go//go/platform:linux": [
"//cmd/cws-instrumentation/command",
"//cmd/cws-instrumentation/subcommands",
],
"//conditions:default": [],
}),
)

go_binary(
name = "cws-instrumentation",
embed = [":cws-instrumentation_lib"],
# keep - This has a main_windows, but is really not implemented.
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
)
30 changes: 29 additions & 1 deletion cmd/cws-instrumentation/subcommands/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
# gazelle:ignore
load("@rules_go//go:def.bzl", "go_library")

go_library(
name = "subcommands",
srcs = [
"subcommands.go",
"subcommands_tracing.go",
],
importpath = "github.com/DataDog/datadog-agent/cmd/cws-instrumentation/subcommands",
target_compatible_with = ["@platforms//os:linux"],
visibility = ["//visibility:public"],
deps = select({
"@rules_go//go/platform:android": [
"//cmd/cws-instrumentation/command",
"//cmd/cws-instrumentation/subcommands/healthcmd",
"//cmd/cws-instrumentation/subcommands/injectcmd",
"//cmd/cws-instrumentation/subcommands/setupcmd",
"//cmd/cws-instrumentation/subcommands/tracecmd",
],
"@rules_go//go/platform:linux": [
"//cmd/cws-instrumentation/command",
"//cmd/cws-instrumentation/subcommands/healthcmd",
"//cmd/cws-instrumentation/subcommands/injectcmd",
"//cmd/cws-instrumentation/subcommands/setupcmd",
"//cmd/cws-instrumentation/subcommands/tracecmd",
],
"//conditions:default": [],
}),
)
23 changes: 23 additions & 0 deletions cmd/cws-instrumentation/subcommands/injectcmd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("@rules_go//go:def.bzl", "go_library")

go_library(
name = "injectcmd",
srcs = ["inject.go"],
importpath = "github.com/DataDog/datadog-agent/cmd/cws-instrumentation/subcommands/injectcmd",
visibility = ["//visibility:public"],
deps = select({
"@rules_go//go/platform:android": [
"//cmd/cws-instrumentation/flags",
"//pkg/security/probe/erpc",
"//pkg/security/secl/model/usersession",
"@com_github_spf13_cobra//:cobra",
],
"@rules_go//go/platform:linux": [
"//cmd/cws-instrumentation/flags",
"//pkg/security/probe/erpc",
"//pkg/security/secl/model/usersession",
"@com_github_spf13_cobra//:cobra",
],
"//conditions:default": [],
}),
)
17 changes: 17 additions & 0 deletions cmd/cws-instrumentation/subcommands/selftestscmd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("@rules_go//go:def.bzl", "go_library")

go_library(
name = "selftestscmd",
srcs = ["selftests.go"],
importpath = "github.com/DataDog/datadog-agent/cmd/cws-instrumentation/subcommands/selftestscmd",
visibility = ["//visibility:public"],
deps = select({
"@rules_go//go/platform:android": [
"@com_github_spf13_cobra//:cobra",
],
"@rules_go//go/platform:linux": [
"@com_github_spf13_cobra//:cobra",
],
"//conditions:default": [],
}),
)
19 changes: 19 additions & 0 deletions cmd/cws-instrumentation/subcommands/setupcmd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
load("@rules_go//go:def.bzl", "go_library")

go_library(
name = "setupcmd",
srcs = ["setup.go"],
importpath = "github.com/DataDog/datadog-agent/cmd/cws-instrumentation/subcommands/setupcmd",
visibility = ["//visibility:public"],
deps = select({
"@rules_go//go/platform:android": [
"//cmd/cws-instrumentation/flags",
"@com_github_spf13_cobra//:cobra",
],
"@rules_go//go/platform:linux": [
"//cmd/cws-instrumentation/flags",
"@com_github_spf13_cobra//:cobra",
],
"//conditions:default": [],
}),
)
23 changes: 23 additions & 0 deletions cmd/cws-instrumentation/subcommands/tracecmd/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("@rules_go//go:def.bzl", "go_library")

go_library(
name = "tracecmd",
srcs = ["trace.go"],
importpath = "github.com/DataDog/datadog-agent/cmd/cws-instrumentation/subcommands/tracecmd",
visibility = ["//visibility:public"],
deps = select({
"@rules_go//go/platform:android": [
"//cmd/cws-instrumentation/subcommands/selftestscmd",
"//pkg/config/setup/constants",
"@//pkg/security/ptracer",
"@com_github_spf13_cobra//:cobra",
],
"@rules_go//go/platform:linux": [
"//cmd/cws-instrumentation/subcommands/selftestscmd",
"//pkg/config/setup/constants",
"@//pkg/security/ptracer",
"@com_github_spf13_cobra//:cobra",
],
"//conditions:default": [],
}),
)
1 change: 1 addition & 0 deletions cmd/internal/runcmd/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ go_test(
name = "runcmd_test",
srcs = ["runcmd_test.go"],
embed = [":runcmd"],
gotags = ["test"],
deps = [
"@com_github_spf13_cobra//:cobra",
"@com_github_stretchr_testify//require",
Expand Down
4 changes: 3 additions & 1 deletion cmd/loader/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""The trace loader."""

# gazelle: exclude
# gazelle:exclude main_nix.go
# gazelle:exclude memory_darwin.go
# gazelle:exclude memory_linux.go

load(
"@rules_pkg//pkg:mappings.bzl",
Expand Down
2 changes: 1 addition & 1 deletion cmd/secret-generic-connector/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# gazelle:ignore
# gazelle:exclude main.go
6 changes: 6 additions & 0 deletions cmd/secret-generic-connector/backend/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# gazelle:exclude hashicorp
# gazelle:exclude backend.go
# gazelle:exclude backend_test.go
# gazelle:exclude error.go
# gazelle:exclude error_test.go
# gazelle:exclude main.go
23 changes: 23 additions & 0 deletions cmd/secret-generic-connector/backend/akeyless/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "akeyless",
srcs = ["vault.go"],
importpath = "github.com/DataDog/datadog-agent/cmd/secret-generic-connector/backend/akeyless",
visibility = ["//visibility:public"],
deps = [
"//cmd/secret-generic-connector/secret",
"@com_github_mitchellh_mapstructure//:mapstructure",
],
)

go_test(
name = "akeyless_test",
srcs = ["vault_test.go"],
embed = [":akeyless"],
gotags = ["test"],
deps = [
"//cmd/secret-generic-connector/secret",
"@com_github_stretchr_testify//assert",
],
)
41 changes: 41 additions & 0 deletions cmd/secret-generic-connector/backend/aws/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "aws",
srcs = [
"secrets.go",
"session.go",
"ssm.go",
],
importpath = "github.com/DataDog/datadog-agent/cmd/secret-generic-connector/backend/aws",
visibility = ["//visibility:public"],
deps = [
"//cmd/secret-generic-connector/secret",
"@com_github_aws_aws_sdk_go_v2//aws",
"@com_github_aws_aws_sdk_go_v2_config//:config",
"@com_github_aws_aws_sdk_go_v2_credentials//:credentials",
"@com_github_aws_aws_sdk_go_v2_credentials//stscreds",
"@com_github_aws_aws_sdk_go_v2_service_secretsmanager//:secretsmanager",
"@com_github_aws_aws_sdk_go_v2_service_ssm//:ssm",
"@com_github_aws_aws_sdk_go_v2_service_sts//:sts",
"@com_github_mitchellh_mapstructure//:mapstructure",
],
)

go_test(
name = "aws_test",
srcs = [
"secrets_test.go",
"ssm_test.go",
],
embed = [":aws"],
gotags = ["test"],
deps = [
"//cmd/secret-generic-connector/secret",
"@com_github_aws_aws_sdk_go_v2//aws",
"@com_github_aws_aws_sdk_go_v2_service_secretsmanager//:secretsmanager",
"@com_github_aws_aws_sdk_go_v2_service_ssm//:ssm",
"@com_github_aws_aws_sdk_go_v2_service_ssm//types",
"@com_github_stretchr_testify//assert",
],
)
27 changes: 27 additions & 0 deletions cmd/secret-generic-connector/backend/azure/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "azure",
srcs = ["keyvault.go"],
importpath = "github.com/DataDog/datadog-agent/cmd/secret-generic-connector/backend/azure",
visibility = ["//visibility:public"],
deps = [
"//cmd/secret-generic-connector/secret",
"@com_github_azure_azure_sdk_for_go_sdk_azcore//:azcore",
"@com_github_azure_azure_sdk_for_go_sdk_azidentity//:azidentity",
"@com_github_azure_azure_sdk_for_go_sdk_security_keyvault_azsecrets//:azsecrets",
"@com_github_mitchellh_mapstructure//:mapstructure",
],
)

go_test(
name = "azure_test",
srcs = ["keyvault_test.go"],
embed = [":azure"],
gotags = ["test"],
deps = [
"//cmd/secret-generic-connector/secret",
"@com_github_azure_azure_sdk_for_go_sdk_security_keyvault_azsecrets//:azsecrets",
"@com_github_stretchr_testify//assert",
],
)
17 changes: 17 additions & 0 deletions cmd/secret-generic-connector/backend/docker/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "docker",
srcs = ["secrets.go"],
importpath = "github.com/DataDog/datadog-agent/cmd/secret-generic-connector/backend/docker",
visibility = ["//visibility:public"],
deps = ["//cmd/secret-generic-connector/backend/file"],
)

go_test(
name = "docker_test",
srcs = ["secrets_test.go"],
embed = [":docker"],
gotags = ["test"],
deps = ["@com_github_stretchr_testify//assert"],
)
32 changes: 32 additions & 0 deletions cmd/secret-generic-connector/backend/file/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "file",
srcs = [
"json.go",
"text.go",
"yaml.go",
],
importpath = "github.com/DataDog/datadog-agent/cmd/secret-generic-connector/backend/file",
visibility = ["//visibility:public"],
deps = [
"//cmd/secret-generic-connector/secret",
"@com_github_mitchellh_mapstructure//:mapstructure",
"@in_yaml_go_yaml_v2//:yaml",
],
)

go_test(
name = "file_test",
srcs = [
"json_test.go",
"text_test.go",
"yaml_test.go",
],
embed = [":file"],
gotags = ["test"],
deps = [
"//cmd/secret-generic-connector/secret",
"@com_github_stretchr_testify//assert",
],
)
22 changes: 22 additions & 0 deletions cmd/secret-generic-connector/backend/gcp/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
load("@rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "gcp",
srcs = ["secrets.go"],
importpath = "github.com/DataDog/datadog-agent/cmd/secret-generic-connector/backend/gcp",
visibility = ["//visibility:public"],
deps = [
"//cmd/secret-generic-connector/secret",
"@com_github_mitchellh_mapstructure//:mapstructure",
"@org_golang_x_oauth2//:oauth2",
"@org_golang_x_oauth2//google",
],
)

go_test(
name = "gcp_test",
srcs = ["secrets_test.go"],
embed = [":gcp"],
gotags = ["test"],
deps = ["@com_github_stretchr_testify//assert"],
)
Loading
Loading