From fc02b8bcf8f37b812c88bcf854066e618753aaca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 23:00:17 +0000 Subject: [PATCH 1/3] Bump google.golang.org/protobuf from 1.31.0 to 1.33.0 Bumps google.golang.org/protobuf from 1.31.0 to 1.33.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index be95e7f..ebe7471 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,7 @@ require ( golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 46c9526..3dab01e 100644 --- a/go.sum +++ b/go.sum @@ -575,8 +575,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 5073a1041afb983e5c0c6d86b4cd6387edc0eaa5 Mon Sep 17 00:00:00 2001 From: Don Khan Date: Fri, 19 Apr 2024 06:52:52 -0400 Subject: [PATCH 2/3] Fix linter errors. --- cmd/topology/main.go | 2 +- internal/k8s/k8sapi_test.go | 10 +++++----- internal/k8s/volume_finder_test.go | 6 +++--- internal/service/service_test.go | 18 +++++++++--------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cmd/topology/main.go b/cmd/topology/main.go index 710c413..03720c9 100644 --- a/cmd/topology/main.go +++ b/cmd/topology/main.go @@ -86,7 +86,7 @@ func main() { updateTracing(logger) viper.WatchConfig() - viper.OnConfigChange(func(e fsnotify.Event) { + viper.OnConfigChange(func(_ fsnotify.Event) { logger.WithField("file", defaultConfigFile).Info("configuration file changed") updateDriverNames(volumeFinder) updateLoggingSettings(logger) diff --git a/internal/k8s/k8sapi_test.go b/internal/k8s/k8sapi_test.go index 8bb4834..2d0e05c 100644 --- a/internal/k8s/k8sapi_test.go +++ b/internal/k8s/k8sapi_test.go @@ -38,19 +38,19 @@ func Test_GetPersistentVolumes(t *testing.T) { type configFn func() (*rest.Config, error) check := func(fns ...checkFn) []checkFn { return fns } - hasNoError := func(t *testing.T, volumes *corev1.PersistentVolumeList, err error) { + hasNoError := func(t *testing.T, _ *corev1.PersistentVolumeList, err error) { if err != nil { t.Fatalf("expected no error") } } checkExpectedOutput := func(expectedOutput *corev1.PersistentVolumeList) func(t *testing.T, volumes *corev1.PersistentVolumeList, err error) { - return func(t *testing.T, volumes *corev1.PersistentVolumeList, err error) { + return func(t *testing.T, volumes *corev1.PersistentVolumeList, _ error) { assert.Equal(t, expectedOutput, volumes) } } - hasError := func(t *testing.T, volumes *corev1.PersistentVolumeList, err error) { + hasError := func(t *testing.T, _ *corev1.PersistentVolumeList, err error) { if err == nil { t.Fatalf("expected error") } @@ -74,7 +74,7 @@ func Test_GetPersistentVolumes(t *testing.T) { return connect, nil, check(hasNoError, checkExpectedOutput(volumes)) }, "error connecting": func(*testing.T) (connectFn, configFn, []checkFn) { - connect := func(api *k8s.API) error { + connect := func(_ *k8s.API) error { return errors.New("error") } return connect, nil, check(hasError) @@ -127,7 +127,7 @@ func Test_NewForConfigError(t *testing.T) { oldNewConfigFn := k8s.NewConfigFn defer func() { k8s.NewConfigFn = oldNewConfigFn }() expected := "could not create Clientset from KubeConfig" - k8s.NewConfigFn = func(config *rest.Config) (*kubernetes.Clientset, error) { + k8s.NewConfigFn = func(_ *rest.Config) (*kubernetes.Clientset, error) { return nil, fmt.Errorf(expected) } diff --git a/internal/k8s/volume_finder_test.go b/internal/k8s/volume_finder_test.go index b2f077c..aff8aeb 100644 --- a/internal/k8s/volume_finder_test.go +++ b/internal/k8s/volume_finder_test.go @@ -39,19 +39,19 @@ func Test_K8sPersistentVolumeFinder(t *testing.T) { type checkFn func(*testing.T, []k8s.VolumeInfo, error) check := func(fns ...checkFn) []checkFn { return fns } - hasNoError := func(t *testing.T, volumes []k8s.VolumeInfo, err error) { + hasNoError := func(t *testing.T, _ []k8s.VolumeInfo, err error) { if err != nil { t.Fatalf("expected no error") } } checkExpectedOutput := func(expectedOutput []k8s.VolumeInfo) func(t *testing.T, volumes []k8s.VolumeInfo, err error) { - return func(t *testing.T, volumes []k8s.VolumeInfo, err error) { + return func(t *testing.T, volumes []k8s.VolumeInfo, _ error) { assert.Equal(t, expectedOutput, volumes) } } - hasError := func(t *testing.T, volumes []k8s.VolumeInfo, err error) { + hasError := func(t *testing.T, _ []k8s.VolumeInfo, err error) { if err == nil { t.Fatalf("expected error") } diff --git a/internal/service/service_test.go b/internal/service/service_test.go index c252967..4642948 100644 --- a/internal/service/service_test.go +++ b/internal/service/service_test.go @@ -98,7 +98,7 @@ func TestSearchHandler(t *testing.T) { check := func(fns ...checkFn) []checkFn { return fns } hasExpectedStatusCode := func(expectedStatus int) func(t *testing.T, response *http.Response, err error) { - return func(t *testing.T, response *http.Response, err error) { + return func(t *testing.T, response *http.Response, _ error) { assert.NotNil(t, response) assert.Equal(t, expectedStatus, response.StatusCode) } @@ -189,7 +189,7 @@ func TestSearchHandler(t *testing.T) { }, } patch := testOverrides{ - marshalFn: func(v interface{}) ([]byte, error) { + marshalFn: func(_ interface{}) ([]byte, error) { return nil, errors.New("error") }, } @@ -211,7 +211,7 @@ func TestSearchHandler(t *testing.T) { }, } patch := testOverrides{ - decodeBodyFn: func(body io.Reader, v interface{}) error { + decodeBodyFn: func(_ io.Reader, _ interface{}) error { return errors.New("error") }, } @@ -235,7 +235,7 @@ func TestSearchHandler(t *testing.T) { volumeFinder.EXPECT().GetPersistentVolumes(gomock.Any()).Times(1).Return(volumeInfo, nil) patch := testOverrides{ - httpWrite: func(w *http.ResponseWriter, data []byte) (int, error) { + httpWrite: func(_ *http.ResponseWriter, _ []byte) (int, error) { return 0, errors.New("error") }, } @@ -280,7 +280,7 @@ func TestQueryHandler(t *testing.T) { check := func(fns ...checkFn) []checkFn { return fns } hasExpectedStatusCode := func(expectedStatus int) func(t *testing.T, body []byte, statusCode int, err error) { - return func(t *testing.T, body []byte, statusCode int, err error) { + return func(t *testing.T, _ []byte, statusCode int, _ error) { assert.Equal(t, expectedStatus, statusCode) } } @@ -391,7 +391,7 @@ func TestQueryHandler(t *testing.T) { volumeFinder.EXPECT().GetPersistentVolumes(gomock.Any()).Times(1).Return(volumeInfo, nil) patch := testOverrides{ - marshalFn: func(v interface{}) ([]byte, error) { + marshalFn: func(_ interface{}) ([]byte, error) { return nil, errors.New("error") }, } @@ -408,7 +408,7 @@ func TestQueryHandler(t *testing.T) { }, } patch := testOverrides{ - decodeBodyFn: func(body io.Reader, v interface{}) error { + decodeBodyFn: func(_ io.Reader, _ interface{}) error { return errors.New("error") }, } @@ -426,7 +426,7 @@ func TestQueryHandler(t *testing.T) { }, } patch := testOverrides{ - unMarshalFn: func(_ []byte, v interface{}) error { + unMarshalFn: func(_ []byte, _ interface{}) error { return errors.New("error") }, } @@ -445,7 +445,7 @@ func TestQueryHandler(t *testing.T) { }, } patch := testOverrides{ - httpWrite: func(w *http.ResponseWriter, data []byte) (int, error) { + httpWrite: func(_ *http.ResponseWriter, _ []byte) (int, error) { return 0, errors.New("error") }, } From 67041fa85b4684bcd0eabce2b890cb494dec845e Mon Sep 17 00:00:00 2001 From: Don Khan Date: Fri, 19 Apr 2024 07:01:39 -0400 Subject: [PATCH 3/3] Update linters.yaml Use latest linter to be consistent with other repos. --- .github/workflows/linters.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml index 43ece07..3380366 100644 --- a/.github/workflows/linters.yaml +++ b/.github/workflows/linters.yaml @@ -24,7 +24,7 @@ jobs: run: | go mod vendor - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: - version: v1.53 + version: latest skip-cache: true