Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(entity): Entity guid validation #1605

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/jedib0t/go-pretty/v6 v6.4.4
github.com/joshdk/go-junit v0.0.0-20210226021600-6145f504ca0d
github.com/mitchellh/go-homedir v1.1.0
github.com/newrelic/newrelic-client-go/v2 v2.33.0
github.com/newrelic/newrelic-client-go/v2 v2.34.1
github.com/pkg/errors v0.9.1
github.com/shirou/gopsutil/v3 v3.23.9
github.com/sirupsen/logrus v1.9.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ github.com/newrelic-forks/task/v3 v3.11.0 h1:8Gwo33tMTqQkWlekCChbCZqf0nrXI85UqVe
github.com/newrelic-forks/task/v3 v3.11.0/go.mod h1:rzfFpA7kl0CsL44ZQd2F2Hic5xOb2m03N6Y2lUjdNo4=
github.com/newrelic/newrelic-client-go/v2 v2.33.0 h1:kUuyWzCdbgt4DtF/VrNh73wSC9BW2H0ricHNcuWQDbM=
github.com/newrelic/newrelic-client-go/v2 v2.33.0/go.mod h1:JCIsx0H/5MPuP9DzOWMFBrfBZ0apc2NZvsk+Q8CFb7k=
github.com/newrelic/newrelic-client-go/v2 v2.34.1 h1:/htTJ+sRKK2q3PFNuLURsur2e9NlQlvPRbAiKyb3Ovg=
github.com/newrelic/newrelic-client-go/v2 v2.34.1/go.mod h1:JCIsx0H/5MPuP9DzOWMFBrfBZ0apc2NZvsk+Q8CFb7k=
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
11 changes: 7 additions & 4 deletions internal/entities/command_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import (

"github.com/spf13/cobra"

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

"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/v2/pkg/changetracking"
"github.com/newrelic/newrelic-client-go/v2/pkg/common"

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

var (
Expand Down Expand Up @@ -68,6 +67,10 @@ The deployment command marks a change for a New Relic entity
log.Fatal("--version cannot be empty")
}

if _, err := entities.DecodeEntityGuid(entityGUID); err != nil {
log.Fatal(err)
}

var (
attrs map[string]interface{}
err error
Expand Down
Loading