Skip to content

Commit 8c699c3

Browse files
authored
Upgrade integrations SDK (NR-302384) (#207)
* upgrade infra-sdk to a compatible v3 version * add entry to changelog * goimports * go mod tidy * go upgrade to 1.23.2 * remove old build comment * add entry to changelog for go 1.22.3
1 parent 8368bf7 commit 8c699c3

20 files changed

+41
-31
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ Unreleased section should follow [Release Toolkit](https://github.com/newrelic/r
88

99
## Unreleased
1010

11+
### dependency
12+
13+
- Upgrade go to 1.23.2
14+
15+
### enhancements
16+
17+
- Upgrade integrations SDK so the interval is variable and allows intervals up to 5 minutes
18+
1119
## v1.5.4 - 2024-09-12
1220

1321
### ⛓️ Dependencies

build/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23.1-bookworm
1+
FROM golang:1.23.2-bookworm
22

33
ARG GH_VERSION='2.4.0'
44

cmd/nri-vsphere/nri-vsphere.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"runtime"
1111
"strings"
1212

13-
"github.com/newrelic/infra-integrations-sdk/integration"
13+
"github.com/newrelic/infra-integrations-sdk/v3/integration"
1414
"github.com/newrelic/nri-vsphere/internal/client"
1515
"github.com/newrelic/nri-vsphere/internal/collect"
1616
"github.com/newrelic/nri-vsphere/internal/config"

go.mod

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module github.com/newrelic/nri-vsphere
22

3-
go 1.23.1
3+
go 1.23.2
44

55
require (
6-
github.com/newrelic/infra-integrations-sdk v3.8.2+incompatible
6+
github.com/newrelic/infra-integrations-sdk/v3 v3.9.1
77
github.com/sirupsen/logrus v1.9.3
88
github.com/stretchr/testify v1.9.0
99
github.com/vmware/govmomi v0.36.3
@@ -14,7 +14,6 @@ require (
1414
require (
1515
github.com/davecgh/go-spew v1.1.1 // indirect
1616
github.com/google/uuid v1.6.0 // indirect
17-
github.com/pkg/errors v0.9.1 // indirect
1817
github.com/pmezard/go-difflib v1.0.0 // indirect
1918
github.com/rogpeppe/go-internal v1.12.0 // indirect
2019
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect

go.sum

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
22
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
33
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
44
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
5+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
56
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
67
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
78
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
9+
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
810
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
9-
github.com/newrelic/infra-integrations-sdk v3.8.2+incompatible h1:Ktcm1aPAl7CW3o+FXAIKJ+jygWVXDXaUIWFyf2CXQTk=
10-
github.com/newrelic/infra-integrations-sdk v3.8.2+incompatible/go.mod h1:tMUHRMq6mJS0YyBnbWrTXAnREnQqC1AGO6Lu45u5xAM=
11-
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
12-
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
11+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
12+
github.com/newrelic/infra-integrations-sdk/v3 v3.9.1 h1:dCtVLsYNHWTQ5aAlAaHroomOUlqxlGTrdi6XTlvBDfI=
13+
github.com/newrelic/infra-integrations-sdk/v3 v3.9.1/go.mod h1:yPeidhcq9Cla0QDquGXH0KqvS2k9xtetFOD7aLA0Z8M=
1314
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1415
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1516
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
@@ -34,6 +35,7 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9w
3435
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3536
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3637
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
38+
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3739
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
3840
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
3941
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

integration-test/integration_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build integration
1+
//go:build integration
22

33
/*
44
* Copyright 2020 New Relic Corporation. All rights reserved.
@@ -27,7 +27,7 @@ import (
2727
"github.com/vmware/govmomi/vim25"
2828
)
2929

30-
//This can set whn running the test as -ldflags "-X github.com/newrelic/nri-winservices/test.integrationPath="
30+
// This can set when running the test as -ldflags "-X github.com/newrelic/nri-winservices/test.integrationPath="
3131
var (
3232
integrationPath = "../bin/nri-vsphere"
3333
)

internal/cache/cache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"time"
66

7-
"github.com/newrelic/infra-integrations-sdk/persist"
7+
"github.com/newrelic/infra-integrations-sdk/v3/persist"
88
)
99

1010
type Cache struct {

internal/cache/cache_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55
"time"
66

7-
"github.com/newrelic/infra-integrations-sdk/persist"
7+
"github.com/newrelic/infra-integrations-sdk/v3/persist"
88
"github.com/stretchr/testify/assert"
99
)
1010

internal/collect/datacenters.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"context"
88
"time"
99

10-
"github.com/newrelic/infra-integrations-sdk/persist"
10+
"github.com/newrelic/infra-integrations-sdk/v3/persist"
1111
"github.com/newrelic/nri-vsphere/internal/cache"
1212
"github.com/newrelic/nri-vsphere/internal/config"
1313
"github.com/newrelic/nri-vsphere/internal/events"

internal/config/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"github.com/newrelic/nri-vsphere/internal/performance"
1414
"github.com/newrelic/nri-vsphere/internal/tag"
1515

16-
sdkArgs "github.com/newrelic/infra-integrations-sdk/args"
17-
"github.com/newrelic/infra-integrations-sdk/integration"
16+
sdkArgs "github.com/newrelic/infra-integrations-sdk/v3/args"
17+
"github.com/newrelic/infra-integrations-sdk/v3/integration"
1818
logrus "github.com/sirupsen/logrus"
1919
"github.com/vmware/govmomi"
2020
"github.com/vmware/govmomi/view"

internal/process/cluster.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"github.com/newrelic/nri-vsphere/internal/config"
1111

12-
"github.com/newrelic/infra-integrations-sdk/data/metric"
12+
"github.com/newrelic/infra-integrations-sdk/v3/data/metric"
1313
)
1414

1515
func createClusterSamples(config *config.Config) {

internal/process/datacenter.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99

1010
"github.com/newrelic/nri-vsphere/internal/config"
1111

12-
eventSDK "github.com/newrelic/infra-integrations-sdk/data/event"
13-
"github.com/newrelic/infra-integrations-sdk/data/metric"
14-
"github.com/newrelic/infra-integrations-sdk/integration"
12+
eventSDK "github.com/newrelic/infra-integrations-sdk/v3/data/event"
13+
"github.com/newrelic/infra-integrations-sdk/v3/data/metric"
14+
"github.com/newrelic/infra-integrations-sdk/v3/integration"
1515
"github.com/newrelic/nri-vsphere/internal/events"
1616
logrus "github.com/sirupsen/logrus"
1717
)

internal/process/datastores.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
"github.com/newrelic/nri-vsphere/internal/config"
1010

11-
"github.com/newrelic/infra-integrations-sdk/data/metric"
11+
"github.com/newrelic/infra-integrations-sdk/v3/data/metric"
1212
"github.com/vmware/govmomi/vim25/types"
1313
)
1414

internal/process/hosts.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"github.com/newrelic/nri-vsphere/internal/config"
1111

12-
"github.com/newrelic/infra-integrations-sdk/data/metric"
12+
"github.com/newrelic/infra-integrations-sdk/v3/data/metric"
1313
)
1414

1515
func createHostSamples(config *config.Config) {

internal/process/process.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"strings"
88
"sync"
99

10-
"github.com/newrelic/infra-integrations-sdk/data/metric"
11-
"github.com/newrelic/infra-integrations-sdk/integration"
10+
"github.com/newrelic/infra-integrations-sdk/v3/data/metric"
11+
"github.com/newrelic/infra-integrations-sdk/v3/integration"
1212
"github.com/newrelic/nri-vsphere/internal/config"
1313

1414
logrus "github.com/sirupsen/logrus"

internal/process/resourcepool.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package process
55

66
import (
7-
"github.com/newrelic/infra-integrations-sdk/data/metric"
7+
"github.com/newrelic/infra-integrations-sdk/v3/data/metric"
88
"github.com/newrelic/nri-vsphere/internal/config"
99
)
1010

internal/process/snapshot.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"github.com/vmware/govmomi/vim25/mo"
1212
"github.com/vmware/govmomi/vim25/types"
1313

14-
"github.com/newrelic/infra-integrations-sdk/data/metric"
15-
"github.com/newrelic/infra-integrations-sdk/integration"
14+
"github.com/newrelic/infra-integrations-sdk/v3/data/metric"
15+
"github.com/newrelic/infra-integrations-sdk/v3/integration"
1616
)
1717

1818
const invalidFile = -1

internal/process/snapshot_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/vmware/govmomi/vim25/mo"
1212
"github.com/vmware/govmomi/vim25/types"
1313

14-
"github.com/newrelic/infra-integrations-sdk/integration"
14+
"github.com/newrelic/infra-integrations-sdk/v3/integration"
1515
"github.com/newrelic/nri-vsphere/internal/process/testdata"
1616
)
1717

internal/process/vms.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strconv"
99
"strings"
1010

11-
"github.com/newrelic/infra-integrations-sdk/data/metric"
11+
"github.com/newrelic/infra-integrations-sdk/v3/data/metric"
1212
"github.com/newrelic/nri-vsphere/internal/config"
1313
)
1414

internal/process/vms_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package process
22

33
import (
44
"context"
5-
"github.com/newrelic/infra-integrations-sdk/integration"
5+
"testing"
6+
7+
"github.com/newrelic/infra-integrations-sdk/v3/integration"
68
"github.com/newrelic/nri-vsphere/internal/client"
79
"github.com/newrelic/nri-vsphere/internal/collect"
810
"github.com/newrelic/nri-vsphere/internal/config"
@@ -13,7 +15,6 @@ import (
1315
"github.com/vmware/govmomi/view"
1416
"github.com/vmware/govmomi/vim25"
1517
"github.com/vmware/govmomi/vim25/mo"
16-
"testing"
1718
)
1819

1920
func Test_createVirtualMachineSamples_HasIpAddresses(t *testing.T) {

0 commit comments

Comments
 (0)