Skip to content

Commit

Permalink
Merge branch 'main' into kfairise/rotate-key-3
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinFairise2 authored Dec 6, 2024
2 parents 3effce1 + e46622a commit c91b158
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
"github.com/DataDog/datadog-agent/pkg/util/testutil/flake"
)

func TestPodParser_Parse(t *testing.T) {
flake.Mark(t)
filterAnnotations := []string{"ignoreAnnotation"}

parser, err := NewPodParser(filterAnnotations)
Expand Down
8 changes: 4 additions & 4 deletions omnibus/config/software/datadog-agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
command "inv -e rtloader.clean"
command "inv -e rtloader.make --install-prefix \"#{windows_safe_path(python_2_embedded)}\" --cmake-options \"-G \\\"Unix Makefiles\\\" \\\"-DPython3_EXECUTABLE=#{windows_safe_path(python_3_embedded)}\\python.exe\"\"", :env => env
command "mv rtloader/bin/*.dll #{install_dir}/bin/agent/"
command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded #{do_windows_sysprobe} --flavor #{flavor_arg}", env: env
command "inv -e systray.build --major-version #{major_version_arg} --rebuild", env: env
command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded #{do_windows_sysprobe} --flavor #{flavor_arg}", env: env
command "inv -e systray.build --major-version #{major_version_arg}", env: env
else
command "inv -e rtloader.clean"
command "inv -e rtloader.make --install-prefix \"#{install_dir}/embedded\" --cmake-options '-DCMAKE_CXX_FLAGS:=\"-D_GLIBCXX_USE_CXX11_ABI=0\" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_FIND_FRAMEWORK:STRING=NEVER -DPython3_EXECUTABLE=#{install_dir}/embedded/bin/python3'", :env => env
Expand All @@ -100,10 +100,10 @@
if linux_target?
include_sds = "--include-sds" # we only support SDS on Linux targets for now
end
command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg}", env: env
command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg}", env: env

if heroku_target?
command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --rebuild --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent", env: env
command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent", env: env
end
end

Expand Down
2 changes: 1 addition & 1 deletion omnibus/config/software/datadog-dogstatsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
end

# we assume the go deps are already installed before running omnibus
command "invoke dogstatsd.build --rebuild --major-version #{major_version_arg}", env: env
command "invoke dogstatsd.build --major-version #{major_version_arg}", env: env

mkdir "#{install_dir}/etc/datadog-dogstatsd"
unless windows_target?
Expand Down
4 changes: 2 additions & 2 deletions omnibus/config/software/datadog-iot-agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
end

if linux_target?
command "invoke agent.build --flavor iot --rebuild --no-development --major-version #{major_version_arg}", env: env
command "invoke agent.build --flavor iot --no-development --major-version #{major_version_arg}", env: env
mkdir "#{install_dir}/bin"
mkdir "#{install_dir}/run/"

Expand All @@ -61,7 +61,7 @@
mkdir conf_dir
mkdir "#{install_dir}/bin/agent"

command "inv agent.build --flavor iot --rebuild --no-development --major-version #{major_version_arg}", env: env
command "inv agent.build --flavor iot --no-development --major-version #{major_version_arg}", env: env

# move around bin and config files
move 'bin/agent/dist/datadog.yaml', "#{conf_dir}/datadog.yaml.example"
Expand Down
4 changes: 2 additions & 2 deletions omnibus/config/software/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
env = with_embedded_path(env)

if linux_target?
command "invoke installer.build --rebuild --no-cgo --run-path=/opt/datadog-packages/run --install-path=#{install_dir}", env: env
command "invoke installer.build --no-cgo --run-path=/opt/datadog-packages/run --install-path=#{install_dir}", env: env
mkdir "#{install_dir}/bin"
copy 'bin/installer', "#{install_dir}/bin/"
elsif windows_target?
command "inv -e installer.build --rebuild --install-path=#{install_dir}", env: env
command "inv -e installer.build --install-path=#{install_dir}", env: env
copy 'bin/installer/installer.exe', "#{install_dir}/datadog-installer.exe"
end

Expand Down
20 changes: 13 additions & 7 deletions pkg/network/tracer/tracer_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,19 @@ func (s *TracerSuite) TestTCPRemoveEntries() {
require.NoError(t, err)
defer c2.Close()

conn, ok := findConnection(c2.LocalAddr(), c2.RemoteAddr(), getConnections(t, tr))
require.True(t, ok)
assert.Equal(t, clientMessageSize, int(conn.Monotonic.SentBytes))
assert.Equal(t, 0, int(conn.Monotonic.RecvBytes))
assert.Equal(t, 0, int(conn.Monotonic.Retransmits))
assert.Equal(t, os.Getpid(), int(conn.Pid))
assert.Equal(t, addrPort(server.Address()), int(conn.DPort))
assert.EventuallyWithT(t, func(ct *assert.CollectT) {
conn, ok := findConnection(c2.LocalAddr(), c2.RemoteAddr(), getConnections(t, tr))
if !assert.True(ct, ok) {
return
}
assert.Equal(ct, clientMessageSize, int(conn.Monotonic.SentBytes))
assert.Equal(ct, 0, int(conn.Monotonic.RecvBytes))
assert.Equal(ct, 0, int(conn.Monotonic.Retransmits))
if !tr.config.EnableEbpfless {
assert.Equal(ct, os.Getpid(), int(conn.Pid))
}
assert.Equal(ct, addrPort(server.Address()), int(conn.DPort))
}, 3*time.Second, 100*time.Millisecond)

// Make sure the first connection got cleaned up
assert.Eventually(t, func() bool {
Expand Down
21 changes: 21 additions & 0 deletions pkg/security/probe/constantfetch/btfhub/constants.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tasks/cws_instrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def build(
ctx,
build_tags=None,
race=False,
incremental_build=True,
rebuild=False,
major_version='7',
go_mod="readonly",
static=False,
Expand Down Expand Up @@ -59,7 +59,7 @@ def build(
build_tags.append("osusergo")

race_opt = "-race" if race else ""
build_type = "" if incremental_build else "-a"
build_type = "-a" if rebuild else ""
go_build_tags = " ".join(build_tags)
agent_bin = BIN_PATH

Expand Down
4 changes: 2 additions & 2 deletions tasks/process_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def build(
build_exclude=None,
install_path=None,
flavor=AgentFlavor.base.name,
incremental_build=False,
rebuild=False,
major_version='7',
go_mod="readonly",
):
Expand Down Expand Up @@ -80,7 +80,7 @@ def build(
args = {
"go_mod": go_mod,
"race_opt": "-race" if race else "",
"build_type": "" if incremental_build else "-a",
"build_type": "-a" if rebuild else "",
"go_build_tags": " ".join(build_tags),
"agent_bin": BIN_PATH,
"gcflags": gcflags,
Expand Down
4 changes: 2 additions & 2 deletions tasks/security_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def build(
ctx,
build_tags,
race=False,
incremental_build=True,
rebuild=False,
install_path=None,
major_version='7',
go_mod="readonly",
Expand Down Expand Up @@ -100,7 +100,7 @@ def build(
args = {
"go_mod": go_mod,
"race_opt": "-race" if race else "",
"build_type": "" if incremental_build else "-a",
"build_type": "-a" if rebuild else "",
"go_build_tags": " ".join(build_tags),
"agent_bin": BIN_PATH,
"gcflags": gcflags,
Expand Down
8 changes: 4 additions & 4 deletions tasks/system_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def get_libpcap_cgo_flags(ctx, install_path: str = None):
def build(
ctx,
race=False,
incremental_build=True,
rebuild=False,
major_version='7',
go_mod="readonly",
arch: str = CURRENT_ARCH,
Expand Down Expand Up @@ -711,7 +711,7 @@ def build(
bundle_ebpf=bundle_ebpf,
go_mod=go_mod,
race=race,
incremental_build=incremental_build,
rebuild=rebuild,
strip_binary=strip_binary,
arch=arch,
static=static,
Expand All @@ -733,7 +733,7 @@ def clean(
def build_sysprobe_binary(
ctx,
race=False,
incremental_build=True,
rebuild=False,
major_version='7',
go_mod="readonly",
arch: str = CURRENT_ARCH,
Expand Down Expand Up @@ -784,7 +784,7 @@ def build_sysprobe_binary(
args = {
"go_mod": go_mod,
"race_opt": " -race" if race else "",
"build_type": "" if incremental_build else " -a",
"build_type": " -a" if rebuild else "",
"go_build_tags": " ".join(build_tags),
"agent_bin": binary,
"gcflags": gcflags,
Expand Down

0 comments on commit c91b158

Please sign in to comment.