Skip to content

Commit

Permalink
[mq] working branch - merge 9481ff4 on top of main at 1c919e8
Browse files Browse the repository at this point in the history
{"baseBranch":"main","baseCommit":"1c919e8238c694ff80562af639bb7eb8c881b497","createdAt":"2024-12-23T11:54:27.026988Z","headSha":"9481ff47deacc54fd888ed2baf909baff2947d77","id":"609f2c22-0c22-4804-9bdb-a2b4f17c76e5","priority":"200","pullRequestNumber":"1310","queuedAt":"2024-12-23T11:54:27.026312Z","status":"STATUS_QUEUED"}
  • Loading branch information
dd-mergequeue[bot] authored Dec 23, 2024
2 parents 633a6f3 + 9481ff4 commit 6e067c4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions common/config/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const (
DDAgentSite = "site"
DDAgentMajorVersion = "majorVersion"
DDAgentExtraEnvVars = "extraEnvVars" // extraEnvVars is expected in the format: <key1>=<value1>,<key2>=<value2>,...
DDAgentJMX = "jmx"
DDAgentFIPS = "fips"

// Updater Namespace
DDUpdaterParamName = "deploy"
Expand Down Expand Up @@ -430,3 +432,11 @@ func (e *CommonEnvironment) GetIntWithDefault(config *sdkconfig.Config, paramNam

return defaultValue
}

func (e *CommonEnvironment) AgentFIPS() bool {
return e.GetBoolWithDefault(e.AgentConfig, DDAgentFIPS, false)
}

func (e *CommonEnvironment) AgentJMX() bool {
return e.GetBoolWithDefault(e.AgentConfig, DDAgentJMX, false)
}
3 changes: 3 additions & 0 deletions components/datadog/agent/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ func dockerAgentComposeManifest(agentImagePath string, apiKey pulumi.StringInput
func defaultAgentParams(params *dockeragentparams.Params) {
// After setting params.FullImagePath check if you need to use JMX Docker image
defer func(p *dockeragentparams.Params) {
if p.FIPS {
p.FullImagePath += "-fips"
}
if p.JMX {
p.FullImagePath = fmt.Sprintf("%s-jmx", p.FullImagePath)
}
Expand Down
10 changes: 10 additions & 0 deletions components/datadog/dockeragentparams/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ type Params struct {
EnvironmentVariables pulumi.StringMap
// PulumiDependsOn is a list of resources to depend on.
PulumiDependsOn []pulumi.ResourceOption
// FIPS is true if FIPS image is needed.
FIPS bool
}

type Option = func(*Params) error
Expand Down Expand Up @@ -91,6 +93,14 @@ func WithJMX() func(*Params) error {
}
}

// WithFIPS makes the image FIPS enabled
func WithFIPS() func(*Params) error {
return func(p *Params) error {
p.FIPS = true
return nil
}
}

func WithFullImagePath(fullImagePath string) func(*Params) error {
return func(p *Params) error {
p.FullImagePath = fullImagePath
Expand Down
8 changes: 8 additions & 0 deletions scenarios/aws/ec2/vm_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ func VMRunWithDocker(ctx *pulumi.Context) error {
agentOptions = append(agentOptions, dockeragentparams.WithImageTag(env.AgentVersion()))
}

if env.AgentJMX() {
agentOptions = append(agentOptions, dockeragentparams.WithJMX())
}

if env.AgentFIPS() {
agentOptions = append(agentOptions, dockeragentparams.WithFIPS())
}

if env.AgentUseFakeintake() {
fakeIntakeOptions := []fakeintake.Option{}

Expand Down

0 comments on commit 6e067c4

Please sign in to comment.