Skip to content

Commit

Permalink
Merge pull request #1381 from newrelic/maria/use-v2-client
Browse files Browse the repository at this point in the history
Upgrade newrelic-client-go to v2
  • Loading branch information
mbazhlekova authored Oct 25, 2022
2 parents f116e80 + 3b71a40 commit 205edb6
Show file tree
Hide file tree
Showing 40 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions cmd/newrelic/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/split"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/newrelic"
nrErrors "github.com/newrelic/newrelic-client-go/pkg/errors"
"github.com/newrelic/newrelic-client-go/v2/newrelic"
nrErrors "github.com/newrelic/newrelic-client-go/v2/pkg/errors"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/jedib0t/go-pretty/v6 v6.4.0
github.com/joshdk/go-junit v0.0.0-20210226021600-6145f504ca0d
github.com/mitchellh/go-homedir v1.1.0
github.com/newrelic/newrelic-client-go v1.1.0
github.com/newrelic/newrelic-client-go/v2 v2.1.0
github.com/pkg/errors v0.9.1
github.com/shirou/gopsutil/v3 v3.22.2
github.com/sirupsen/logrus v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
github.com/newrelic/newrelic-client-go v1.1.0 h1:aflNjzQ21c+2GwBVh+UbAf9lznkRfCcVABoc5UM4IXw=
github.com/newrelic/newrelic-client-go v1.1.0/go.mod h1:RYMXt7hgYw7nzuXIGd2BH0F1AivgWw7WrBhNBQZEB4k=
github.com/newrelic/newrelic-client-go/v2 v2.1.0 h1:UfrRxEGbDokFLrYWiDjLsIwmY9DlhlKAwJ5PjhsycI0=
github.com/newrelic/newrelic-client-go/v2 v2.1.0/go.mod h1:xDZ6IDWI6fpl7MhTI4Hk75alJLAIfXzOt/rINEolxhQ=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
Expand Down
2 changes: 1 addition & 1 deletion internal/apiaccess/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/newrelic/newrelic-cli/internal/client"
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/apiaccess"
"github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess"
)

var Command = &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions internal/apm/command_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/newrelic/newrelic-client-go/pkg/common"
"github.com/newrelic/newrelic-client-go/pkg/entities"
"github.com/newrelic/newrelic-client-go/v2/pkg/common"
"github.com/newrelic/newrelic-client-go/v2/pkg/entities"

"github.com/newrelic/newrelic-cli/internal/client"
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
Expand Down
2 changes: 1 addition & 1 deletion internal/apm/command_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/newrelic/newrelic-client-go/pkg/apm"
"github.com/newrelic/newrelic-client-go/v2/pkg/apm"

"github.com/newrelic/newrelic-cli/internal/client"
"github.com/newrelic/newrelic-cli/internal/output"
Expand Down
6 changes: 3 additions & 3 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/install/types"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/newrelic"
"github.com/newrelic/newrelic-client-go/pkg/apiaccess"
clientLogging "github.com/newrelic/newrelic-client-go/pkg/logging"
"github.com/newrelic/newrelic-client-go/v2/newrelic"
"github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess"
clientLogging "github.com/newrelic/newrelic-client-go/v2/pkg/logging"

log "github.com/sirupsen/logrus"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/mitchellh/go-homedir"
log "github.com/sirupsen/logrus"

"github.com/newrelic/newrelic-client-go/pkg/region"
"github.com/newrelic/newrelic-client-go/v2/pkg/region"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions internal/diagnose/config_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-cli/internal/utils/validation"
"github.com/newrelic/newrelic-client-go/newrelic"
"github.com/newrelic/newrelic-client-go/pkg/apiaccess"
nrErrors "github.com/newrelic/newrelic-client-go/pkg/errors"
"github.com/newrelic/newrelic-client-go/v2/newrelic"
"github.com/newrelic/newrelic-client-go/v2/pkg/apiaccess"
nrErrors "github.com/newrelic/newrelic-client-go/v2/pkg/errors"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/edge/command_trace_observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/edge"
"github.com/newrelic/newrelic-client-go/v2/pkg/edge"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/entities/command_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/newrelic/newrelic-cli/internal/client"
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/entities"
"github.com/newrelic/newrelic-client-go/v2/pkg/entities"
)

var cmdEntitySearch = &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions internal/entities/command_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/newrelic/newrelic-client-go/pkg/common"
"github.com/newrelic/newrelic-client-go/pkg/entities"
"github.com/newrelic/newrelic-client-go/v2/pkg/common"
"github.com/newrelic/newrelic-client-go/v2/pkg/entities"

"github.com/newrelic/newrelic-cli/internal/client"
"github.com/newrelic/newrelic-cli/internal/output"
Expand Down
2 changes: 1 addition & 1 deletion internal/entities/command_tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"

"github.com/newrelic/newrelic-client-go/pkg/entities"
"github.com/newrelic/newrelic-client-go/v2/pkg/entities"
)

func TestEntitiesGetTags(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/install/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/install/types"
"github.com/newrelic/newrelic-cli/internal/utils"
nrErrors "github.com/newrelic/newrelic-client-go/pkg/errors"
nrErrors "github.com/newrelic/newrelic-client-go/v2/pkg/errors"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/install/execution/installevents_client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package execution

import "github.com/newrelic/newrelic-client-go/pkg/installevents"
import "github.com/newrelic/newrelic-client-go/v2/pkg/installevents"

type InstallEventsClient interface {
InstallationCreateRecipeEvent(int, installevents.InstallationRecipeStatus) (*installevents.InstallationRecipeEvent, error)
Expand Down
4 changes: 2 additions & 2 deletions internal/install/execution/installevents_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

log "github.com/sirupsen/logrus"

"github.com/newrelic/newrelic-client-go/pkg/common"
"github.com/newrelic/newrelic-client-go/pkg/installevents"
"github.com/newrelic/newrelic-client-go/v2/pkg/common"
"github.com/newrelic/newrelic-client-go/v2/pkg/installevents"

configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/install/types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/stretchr/testify/require"

"github.com/newrelic/newrelic-cli/internal/install/types"
"github.com/newrelic/newrelic-client-go/newrelic"
"github.com/newrelic/newrelic-client-go/pkg/config"
"github.com/newrelic/newrelic-client-go/v2/newrelic"
"github.com/newrelic/newrelic-client-go/v2/pkg/config"
)

func TestInstallEventsReporter_Basic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/install/execution/mock_installevents_client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package execution

import "github.com/newrelic/newrelic-client-go/pkg/installevents"
import "github.com/newrelic/newrelic-client-go/v2/pkg/installevents"

type MockInstalleventsClient struct {
CreateInstallEventVal *installevents.InstallationRecipeEvent
Expand Down
2 changes: 1 addition & 1 deletion internal/install/execution/mock_nerdstorage_client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package execution

import "github.com/newrelic/newrelic-client-go/pkg/nerdstorage"
import "github.com/newrelic/newrelic-client-go/v2/pkg/nerdstorage"

type MockNerdStorageClient struct {
WriteDocumentWithUserScopeVal interface{}
Expand Down
2 changes: 1 addition & 1 deletion internal/install/execution/nerdstorage_client.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package execution

import (
"github.com/newrelic/newrelic-client-go/pkg/nerdstorage"
"github.com/newrelic/newrelic-client-go/v2/pkg/nerdstorage"
)

type NerdStorageClient interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/install/execution/nerdstorage_status_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/install/types"
"github.com/newrelic/newrelic-client-go/pkg/nerdstorage"
"github.com/newrelic/newrelic-client-go/v2/pkg/nerdstorage"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (

"github.com/stretchr/testify/require"

"github.com/newrelic/newrelic-client-go/newrelic"
"github.com/newrelic/newrelic-client-go/pkg/common"
"github.com/newrelic/newrelic-client-go/pkg/config"
"github.com/newrelic/newrelic-client-go/pkg/nerdstorage"
"github.com/newrelic/newrelic-client-go/pkg/workloads"
"github.com/newrelic/newrelic-client-go/v2/newrelic"
"github.com/newrelic/newrelic-client-go/v2/pkg/common"
"github.com/newrelic/newrelic-client-go/v2/pkg/config"
"github.com/newrelic/newrelic-client-go/v2/pkg/nerdstorage"
"github.com/newrelic/newrelic-client-go/v2/pkg/workloads"

"github.com/newrelic/newrelic-cli/internal/install/types"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/install/execution/platform_link_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/newrelic/newrelic-cli/internal/config"
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/region"
"github.com/newrelic/newrelic-client-go/v2/pkg/region"
)

type PlatformLinkGenerator struct {
Expand Down
6 changes: 3 additions & 3 deletions internal/install/execution/recipe_log_forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
log "github.com/sirupsen/logrus"
"golang.org/x/net/context"

nrConfig "github.com/newrelic/newrelic-client-go/pkg/config"
nrLogs "github.com/newrelic/newrelic-client-go/pkg/logs"
"github.com/newrelic/newrelic-client-go/pkg/region"
nrConfig "github.com/newrelic/newrelic-client-go/v2/pkg/config"
nrLogs "github.com/newrelic/newrelic-client-go/v2/pkg/logs"
"github.com/newrelic/newrelic-client-go/v2/pkg/region"
)

type LogEntry struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/install/recipe_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/newrelic/newrelic-cli/internal/install/ux"
"github.com/newrelic/newrelic-cli/internal/install/validation"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/newrelic"
"github.com/newrelic/newrelic-client-go/v2/newrelic"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/install/recipe_installer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/newrelic/newrelic-cli/internal/install/recipes"
"github.com/newrelic/newrelic-cli/internal/install/types"
"github.com/newrelic/newrelic-cli/internal/install/ux"
nrErrors "github.com/newrelic/newrelic-client-go/pkg/errors"
nrErrors "github.com/newrelic/newrelic-client-go/v2/pkg/errors"
)

func TestConnectToPlatformShouldSuccess(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/install/validation/mock_nrdb_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"errors"

"github.com/newrelic/newrelic-client-go/pkg/nrdb"
"github.com/newrelic/newrelic-client-go/v2/pkg/nrdb"
)

type MockNRDBClient struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/newrelic/newrelic-cli/internal/install/types"
"github.com/newrelic/newrelic-client-go/pkg/nrdb"
"github.com/newrelic/newrelic-client-go/v2/pkg/nrdb"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/nerdgraph/command_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/newrelic/newrelic-cli/internal/client"
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/utils"
ng "github.com/newrelic/newrelic-client-go/pkg/nerdgraph"
ng "github.com/newrelic/newrelic-client-go/v2/pkg/nerdgraph"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/nerdstorage/command_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/nerdstorage"
"github.com/newrelic/newrelic-client-go/v2/pkg/nerdstorage"
)

var cmdCollection = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion internal/nerdstorage/command_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/nerdstorage"
"github.com/newrelic/newrelic-client-go/v2/pkg/nerdstorage"
)

var cmdDocument = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion internal/nrql/command_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/nrdb"
"github.com/newrelic/newrelic-client-go/v2/pkg/nrdb"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/profile/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/accounts"
"github.com/newrelic/newrelic-client-go/v2/pkg/accounts"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/synthetics/command_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/output"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/entities"
"github.com/newrelic/newrelic-client-go/pkg/synthetics"
"github.com/newrelic/newrelic-client-go/v2/pkg/entities"
"github.com/newrelic/newrelic-client-go/v2/pkg/synthetics"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/nrdb_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package utils
import (
"context"

"github.com/newrelic/newrelic-client-go/pkg/nrdb"
"github.com/newrelic/newrelic-client-go/v2/pkg/nrdb"
)

type NRDBClient interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"time"

nrErrors "github.com/newrelic/newrelic-client-go/pkg/errors"
nrErrors "github.com/newrelic/newrelic-client-go/v2/pkg/errors"
)

type RetryContext struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/stretchr/testify/require"

nrErrors "github.com/newrelic/newrelic-client-go/pkg/errors"
nrErrors "github.com/newrelic/newrelic-client-go/v2/pkg/errors"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/terraform/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

log "github.com/sirupsen/logrus"

"github.com/newrelic/newrelic-client-go/pkg/dashboards"
"github.com/newrelic/newrelic-client-go/v2/pkg/dashboards"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/utils/validation/polling_nrql_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
"github.com/newrelic/newrelic-cli/internal/utils"
"github.com/newrelic/newrelic-client-go/pkg/nrdb"
"github.com/newrelic/newrelic-client-go/v2/pkg/nrdb"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions internal/workload/command_workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/newrelic/newrelic-client-go/pkg/common"
"github.com/newrelic/newrelic-client-go/pkg/entities"
"github.com/newrelic/newrelic-client-go/pkg/workloads"
"github.com/newrelic/newrelic-client-go/v2/pkg/common"
"github.com/newrelic/newrelic-client-go/v2/pkg/entities"
"github.com/newrelic/newrelic-client-go/v2/pkg/workloads"

"github.com/newrelic/newrelic-cli/internal/client"
configAPI "github.com/newrelic/newrelic-cli/internal/config/api"
Expand Down

0 comments on commit 205edb6

Please sign in to comment.