From 7bc2c5ae492af0fdb0d4b89153a3705dfa6a7c5f Mon Sep 17 00:00:00 2001 From: Gaurab Manandhar Date: Thu, 8 Aug 2024 19:20:45 +0530 Subject: [PATCH 1/3] fix(browseragent): changing cookiesEnabled field to pointer type --- newrelic/resource_newrelic_agent_application_browser.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/newrelic/resource_newrelic_agent_application_browser.go b/newrelic/resource_newrelic_agent_application_browser.go index db050fd7a..d375dbe97 100644 --- a/newrelic/resource_newrelic_agent_application_browser.go +++ b/newrelic/resource_newrelic_agent_application_browser.go @@ -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))), } @@ -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, }, }, } From 9585eb2cc4057a1c1a31d59b0033ef95c75d538e Mon Sep 17 00:00:00 2001 From: Gaurab Manandhar Date: Fri, 9 Aug 2024 12:36:24 +0530 Subject: [PATCH 2/3] fix(browseragent): updated the version of go client to point to relevant version of go client --- go.mod | 2 ++ go.sum | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index b888aec05..ce1fd944e 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/newrelic/terraform-provider-newrelic/v2 go 1.21 +replace github.com/newrelic/newrelic-client-go/v2 => github.com/newrelic/newrelic-client-go/v2 v2.42.2-0.20240808135402-bee265ae0a0c + require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index 4433c3868..7ee1da26d 100644 --- a/go.sum +++ b/go.sum @@ -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.42.1 h1:IztJJ2coZaU87y1MZfKueGO/setV/zIYC5Yamg7Mxi0= -github.com/newrelic/newrelic-client-go/v2 v2.42.1/go.mod h1:pDFY24/6iIMEbPIdowTRrRn9YYwkXc3j+B+XpTb4oF4= +github.com/newrelic/newrelic-client-go/v2 v2.42.2-0.20240808135402-bee265ae0a0c h1:Da5v7BfgCvFUn6hLIb/7CGf1sFAOFYgkymwHI8krVKI= +github.com/newrelic/newrelic-client-go/v2 v2.42.2-0.20240808135402-bee265ae0a0c/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= From d5017fd9a6d2a27f93f66ed11f46fd59a548e461 Mon Sep 17 00:00:00 2001 From: Gaurab Manandhar Date: Wed, 14 Aug 2024 12:26:53 +0530 Subject: [PATCH 3/3] fix(browseragent): changing the version of client go to release version --- go.mod | 4 +--- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index ce1fd944e..c1d2b5856 100644 --- a/go.mod +++ b/go.mod @@ -2,14 +2,12 @@ module github.com/newrelic/terraform-provider-newrelic/v2 go 1.21 -replace github.com/newrelic/newrelic-client-go/v2 => github.com/newrelic/newrelic-client-go/v2 v2.42.2-0.20240808135402-bee265ae0a0c - require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1 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.42.1 + 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 ) diff --git a/go.sum b/go.sum index 7ee1da26d..028492edc 100644 --- a/go.sum +++ b/go.sum @@ -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.42.2-0.20240808135402-bee265ae0a0c h1:Da5v7BfgCvFUn6hLIb/7CGf1sFAOFYgkymwHI8krVKI= -github.com/newrelic/newrelic-client-go/v2 v2.42.2-0.20240808135402-bee265ae0a0c/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=