From 9481ff47deacc54fd888ed2baf909baff2947d77 Mon Sep 17 00:00:00 2001 From: Vikentiy Fesunov Date: Fri, 20 Dec 2024 13:37:02 +0000 Subject: [PATCH] Combine defers --- components/datadog/agent/docker.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/datadog/agent/docker.go b/components/datadog/agent/docker.go index 93d2fdcfb..7f82a452f 100644 --- a/components/datadog/agent/docker.go +++ b/components/datadog/agent/docker.go @@ -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 != "" {