Skip to content

Commit 2545a82

Browse files
test: add rofs disabled to dd disabled test
1 parent 0e28eaf commit 2545a82

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

modules/ecs_fargate/datadog.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ locals {
7979

8080
dd_agent_mount = concat(
8181
local.apm_dsd_mount,
82-
[
82+
var.dd_readonly_root_filesystem ? [
8383
{
8484
containerPath = "/etc/datadog-agent"
8585
sourceVolume = "agent-config"
@@ -95,7 +95,7 @@ locals {
9595
sourceVolume = "agent-run"
9696
readOnly = false
9797
}
98-
]
98+
] : []
9999
)
100100

101101
apm_socket_var = local.is_apm_socket_mount ? [

smoke_tests/ecs_fargate/all-dd-disabled.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module "dd_task_all_dd_disabled" {
1717
dd_tags = "team:cont-p, owner:container-monitoring"
1818
dd_essential = true
1919
dd_is_datadog_dependency_enabled = false
20+
dd_readonly_root_filesystem = false
2021

2122
dd_environment = []
2223

tests/all_dd_disabled_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (s *ECSFargateSuite) TestAllDDDisabled() {
2626

2727
err := json.Unmarshal([]byte(task["container_definitions"]), &containers)
2828
s.NoError(err, "Failed to parse container definitions")
29-
s.Equal(3, len(containers), "Expected 2 containers in the task definition")
29+
s.Equal(2, len(containers), "Expected 2 containers in the task definition")
3030

3131
// Test Agent Container
3232
agentContainer, found := GetContainer(containers, "datadog-agent")
@@ -59,11 +59,7 @@ func (s *ECSFargateSuite) TestAllDDDisabled() {
5959
s.Equal(int32(3), *agentContainer.HealthCheck.Retries, "Agent health check retries should be 3")
6060
s.Equal(int32(60), *agentContainer.HealthCheck.StartPeriod, "Agent health check start period should be 60")
6161

62-
s.Equal(3, len(agentContainer.MountPoints), "Expected 3 mount points when features are disabled")
63-
// Verify none are apm/dsd volume mount points
64-
for _, mountPoint := range agentContainer.MountPoints {
65-
s.NotEqual("dd-socket", *mountPoint.SourceVolume, "Mount point should not be dd-socket")
66-
}
62+
s.Equal(0, len(agentContainer.MountPoints), "Expected no mount points when features are disabled")
6763

6864
// Test dummy container
6965
dummyContainer, found := GetContainer(containers, "dummy-container")

0 commit comments

Comments
 (0)