From c5ba5f538876845665f017d796906dc00b6609da Mon Sep 17 00:00:00 2001 From: pranav-new-relic Date: Fri, 5 Jan 2024 07:48:01 +0530 Subject: [PATCH] chore: point to pk/NR-76861 in client-go temporarily --- go.mod | 4 +++- go.sum | 4 ++-- newrelic/resource_newrelic_user_group.go | 12 ++++++------ newrelic/structures_newrelic_workflow.go | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 33fe908f18..b4d22cec0c 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,9 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/newrelic/go-agent/v3 v3.27.0 github.com/newrelic/go-insights v1.0.3 - github.com/newrelic/newrelic-client-go/v2 v2.23.0 + // TEMPORARILY POINTING TO THE LATEST COMMIT OF https://github.com/newrelic/newrelic-client-go/pull/981/commits + // TO BE DISCARDED BEFORE MERGE + github.com/newrelic/newrelic-client-go/v2 v2.23.1-0.20240105021304-d96860faffa7 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20231006140011-7918f672742d ) diff --git a/go.sum b/go.sum index d17570eb0a..6f0ab7c5b7 100644 --- a/go.sum +++ b/go.sum @@ -267,8 +267,8 @@ github.com/newrelic/go-agent/v3 v3.27.0 h1:Z3XB49d8FKjRcGzCyViCO9itBxiLPSpwjY1Hl github.com/newrelic/go-agent/v3 v3.27.0/go.mod h1:TUzePinDc0BMH4Sui66rl4SBe6yOKJ5X/bRJekwuAtM= 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.23.0 h1:ULqiPv4Z0QVLjMjX6uP13wSxPDL3uiKTt5U8vFsvpCQ= -github.com/newrelic/newrelic-client-go/v2 v2.23.0/go.mod h1:VPWTvEfKvnTZLunAC7fiW33y4e0srznNfN5HJH2cOp8= +github.com/newrelic/newrelic-client-go/v2 v2.23.1-0.20240105021304-d96860faffa7 h1:D9I9bUS5GU/RKCGT2ENOOFVE8eZB7kzv/HIyiKlARIo= +github.com/newrelic/newrelic-client-go/v2 v2.23.1-0.20240105021304-d96860faffa7/go.mod h1:VPWTvEfKvnTZLunAC7fiW33y4e0srznNfN5HJH2cOp8= 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= diff --git a/newrelic/resource_newrelic_user_group.go b/newrelic/resource_newrelic_user_group.go index 08321cec21..4aaf039a63 100644 --- a/newrelic/resource_newrelic_user_group.go +++ b/newrelic/resource_newrelic_user_group.go @@ -72,9 +72,9 @@ func resourceNewRelicUserGroupRead(ctx context.Context, d *schema.ResourceData, providerConfig := meta.(*ProviderConfig) client := providerConfig.NewClient - groupId := d.Id() - authenticationDomainId := d.Get("authentication_domain_id").(string) - group, err := getUserGroupID(ctx, client, authenticationDomainId, groupId) + groupID := d.Id() + authenticationDomainID := d.Get("authentication_domain_id").(string) + group, err := getUserGroupID(ctx, client, authenticationDomainID, groupID) if err != nil && group == nil { d.SetId("") @@ -92,8 +92,8 @@ func resourceNewRelicUserGroupRead(ctx context.Context, d *schema.ResourceData, return nil } -func getUserGroupID(ctx context.Context, client *newrelic.NewRelic, authId string, groupId string) (groups *usermanagement.UserManagementGroup, err error) { - id := []string{authId} +func getUserGroupID(ctx context.Context, client *newrelic.NewRelic, authID string, groupID string) (groups *usermanagement.UserManagementGroup, err error) { + id := []string{authID} resp, err := client.UserManagement.GetAuthenticationDomainsWithContext(ctx, id) if err != nil { return nil, err @@ -101,7 +101,7 @@ func getUserGroupID(ctx context.Context, client *newrelic.NewRelic, authId strin for i, groupList := range *resp { if i == 0 { for _, group := range groupList.Groups.Groups { - if group.ID == groupId { + if group.ID == groupID { return &group, nil } } diff --git a/newrelic/structures_newrelic_workflow.go b/newrelic/structures_newrelic_workflow.go index 77a438c6ee..dd4fecd7d5 100644 --- a/newrelic/structures_newrelic_workflow.go +++ b/newrelic/structures_newrelic_workflow.go @@ -3,6 +3,7 @@ package newrelic import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/newrelic/newrelic-client-go/v2/pkg/ai" "github.com/newrelic/newrelic-client-go/v2/pkg/workflows"