Skip to content

Commit

Permalink
fix(browseragent): changing cookiesEnabled field to pointer type (#2726)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmanandhar-nr authored Aug 14, 2024
1 parent c8c61a8 commit d2f4832
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/newrelic/go-agent/v3 v3.30.0
github.com/newrelic/go-insights v1.0.3
github.com/newrelic/newrelic-client-go/v2 v2.43.0
github.com/newrelic/newrelic-client-go/v2 v2.43.1
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ github.com/newrelic/go-agent/v3 v3.30.0 h1:ZXHCT/Cot4iIPwcegCZURuRQOsfmGA6wilW+S
github.com/newrelic/go-agent/v3 v3.30.0/go.mod h1:9utrgxlSryNqRrTvII2XBL+0lpofXbqXApvVWPpbzUg=
github.com/newrelic/go-insights v1.0.3 h1:zSNp1CEZnXktzSIEsbHJk8v6ZihdPFP2WsO/fzau3OQ=
github.com/newrelic/go-insights v1.0.3/go.mod h1:A20BoT8TNkqPGX2nS/Z2fYmKl3Cqa3iKZd4whzedCY4=
github.com/newrelic/newrelic-client-go/v2 v2.43.0 h1:w0at7osH5aY48qNEagjSFOBP1WvRLQv9F6BNDwCscog=
github.com/newrelic/newrelic-client-go/v2 v2.43.0/go.mod h1:pDFY24/6iIMEbPIdowTRrRn9YYwkXc3j+B+XpTb4oF4=
github.com/newrelic/newrelic-client-go/v2 v2.43.1 h1:ewnyHowf77wq3Of5zlwq7NxY02vzHKENipc6et2y5AA=
github.com/newrelic/newrelic-client-go/v2 v2.43.1/go.mod h1:pDFY24/6iIMEbPIdowTRrRn9YYwkXc3j+B+XpTb4oF4=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
Expand Down
6 changes: 4 additions & 2 deletions newrelic/resource_newrelic_agent_application_browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ func resourceNewRelicBrowserApplicationCreate(ctx context.Context, d *schema.Res

accountID := selectAccountID(providerConfig, d)
appName := d.Get("name").(string)
cookiesEnabled := d.Get("cookies_enabled").(bool)
settingsInput := agentapplications.AgentApplicationBrowserSettingsInput{
CookiesEnabled: d.Get("cookies_enabled").(bool),
CookiesEnabled: &cookiesEnabled,
DistributedTracingEnabled: d.Get("distributed_tracing_enabled").(bool),
LoaderType: agentapplications.AgentApplicationBrowserLoader(strings.ToUpper(d.Get("loader_type").(string))),
}
Expand Down Expand Up @@ -157,13 +158,14 @@ func resourceNewRelicBrowserApplicationUpdate(ctx context.Context, d *schema.Res
providerConfig := meta.(*ProviderConfig)
client := providerConfig.NewClient

cookiesEnabled := d.Get("cookies_enabled").(bool)
settingsInput := agentapplications.AgentApplicationSettingsUpdateInput{
BrowserMonitoring: &agentapplications.AgentApplicationSettingsBrowserMonitoringInput{
DistributedTracing: &agentapplications.AgentApplicationSettingsBrowserDistributedTracingInput{
Enabled: d.Get("distributed_tracing_enabled").(bool),
},
Privacy: &agentapplications.AgentApplicationSettingsBrowserPrivacyInput{
CookiesEnabled: d.Get("cookies_enabled").(bool),
CookiesEnabled: &cookiesEnabled,
},
},
}
Expand Down

0 comments on commit d2f4832

Please sign in to comment.