From 60d4126fec9851e73bbebd225881f59d25f4fe4e Mon Sep 17 00:00:00 2001 From: pducolin <45568537+pducolin@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:49:57 -0400 Subject: [PATCH] [e2e] add stack id to tags in agent config on aws host (#28938) --- test/new-e2e/pkg/environments/aws/host/host.go | 3 ++- test/new-e2e/pkg/environments/aws/host/windows/host.go | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/new-e2e/pkg/environments/aws/host/host.go b/test/new-e2e/pkg/environments/aws/host/host.go index 7652d9b846576..4668905ac83a8 100644 --- a/test/new-e2e/pkg/environments/aws/host/host.go +++ b/test/new-e2e/pkg/environments/aws/host/host.go @@ -261,7 +261,8 @@ func Run(ctx *pulumi.Context, env *environments.Host, runParams RunParams) error // todo: add agent once updater installs agent on bootstrap env.Agent = nil } else if params.agentOptions != nil { - agent, err := agent.NewHostAgent(&awsEnv, host, params.agentOptions...) + agentOptions := append(params.agentOptions, agentparams.WithTags([]string{fmt.Sprintf("stackid:%s", ctx.Stack())})) + agent, err := agent.NewHostAgent(&awsEnv, host, agentOptions...) if err != nil { return err } diff --git a/test/new-e2e/pkg/environments/aws/host/windows/host.go b/test/new-e2e/pkg/environments/aws/host/windows/host.go index 7fcb44f05da53..1fd5885a88c4d 100644 --- a/test/new-e2e/pkg/environments/aws/host/windows/host.go +++ b/test/new-e2e/pkg/environments/aws/host/windows/host.go @@ -8,7 +8,7 @@ package winawshost import ( "fmt" - installer "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components/datadog-installer" + "github.com/DataDog/test-infra-definitions/components/activedirectory" "github.com/DataDog/test-infra-definitions/components/datadog/agent" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" @@ -18,6 +18,8 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + installer "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components/datadog-installer" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" @@ -202,7 +204,8 @@ func Run(ctx *pulumi.Context, env *environments.WindowsHost, params *Provisioner } if params.agentOptions != nil { - agent, err := agent.NewHostAgent(&awsEnv, host, params.agentOptions...) + agentOptions := append(params.agentOptions, agentparams.WithTags([]string{fmt.Sprintf("stackid:%s", ctx.Stack())})) + agent, err := agent.NewHostAgent(&awsEnv, host, agentOptions...) if err != nil { return err }