Skip to content

Commit

Permalink
Combine defers
Browse files Browse the repository at this point in the history
  • Loading branch information
vickenty committed Dec 20, 2024
1 parent 3ac0e0e commit 9481ff4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions components/datadog/agent/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,13 @@ 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.JMX {
p.FullImagePath = fmt.Sprintf("%s-jmx", p.FullImagePath)
}
}(params)
defer func(p *dockeragentparams.Params) {
if p.FIPS {
p.FullImagePath += "-fips"
}
if p.JMX {
p.FullImagePath = fmt.Sprintf("%s-jmx", p.FullImagePath)
}
}(params)

if params.FullImagePath != "" {
Expand Down

0 comments on commit 9481ff4

Please sign in to comment.