Skip to content

Commit

Permalink
Fix order of suffixes
Browse files Browse the repository at this point in the history
The image name is `foo-fips-jmx`. `-fips` must be added to the
suffix first, thus it's defer must come last.
  • Loading branch information
vickenty committed Dec 18, 2024
1 parent 506ecd0 commit 51cd5b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/datadog/agent/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ func dockerAgentComposeManifest(agentImagePath string, apiKey pulumi.StringInput
}

func defaultAgentParams(params *dockeragentparams.Params) {
defer func(p *dockeragentparams.Params) {
if p.FIPS {
p.FullImagePath += "-fips"
}
}(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"
}
}(params)

if params.FullImagePath != "" {
return
Expand Down

0 comments on commit 51cd5b6

Please sign in to comment.