Skip to content

Commit

Permalink
chore: point to pk/NR-76861 in client-go temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-new-relic committed Jan 5, 2024
1 parent 9276cbd commit c5ba5f5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
12 changes: 6 additions & 6 deletions newrelic/resource_newrelic_user_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
Expand All @@ -92,16 +92,16 @@ 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
}
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
}
}
Expand Down
1 change: 1 addition & 0 deletions newrelic/structures_newrelic_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c5ba5f5

Please sign in to comment.