From 889e9c04a848eeaa49c6466002d8c000aeeb9975 Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Wed, 10 Jan 2024 23:08:31 -0800 Subject: [PATCH 1/2] Bump linter to 1.52.2 Signed-off-by: Faisal Memon --- Makefile | 2 +- pkg/sidecar/sidecar.go | 11 ++--------- pkg/sidecar/util_posix.go | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index c2863cc9..c4c7e7ac 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ else endif go_path := PATH="$(go_bin_dir):$(PATH)" -golangci_lint_version = v1.51.1 +golangci_lint_version = v1.52.2 golangci_lint_dir = $(build_dir)/golangci_lint/$(golangci_lint_version) golangci_lint_bin = $(golangci_lint_dir)/golangci-lint golangci_lint_cache = $(golangci_lint_dir)/cache diff --git a/pkg/sidecar/sidecar.go b/pkg/sidecar/sidecar.go index 54d7b70f..e3e48146 100644 --- a/pkg/sidecar/sidecar.go +++ b/pkg/sidecar/sidecar.go @@ -237,11 +237,7 @@ func (s *Sidecar) dumpBundles(svidResponse *workloadapi.X509Context) error { return err } - if err := writeCerts(svidBundleFile, bundles); err != nil { - return err - } - - return nil + return writeCerts(svidBundleFile, bundles) } func (s *Sidecar) writeJSON(fileName string, certs map[string]interface{}) error { @@ -251,11 +247,8 @@ func (s *Sidecar) writeJSON(fileName string, certs map[string]interface{}) error } jsonPath := path.Join(s.config.CertDir, fileName) - if err = os.WriteFile(jsonPath, file, os.ModePerm); err != nil { - return err - } - return nil + return os.WriteFile(jsonPath, file, os.ModePerm) } func (s *Sidecar) updateJWTBundle(jwkSet *jwtbundle.Set) { diff --git a/pkg/sidecar/util_posix.go b/pkg/sidecar/util_posix.go index 15cfd5aa..6d8daefc 100644 --- a/pkg/sidecar/util_posix.go +++ b/pkg/sidecar/util_posix.go @@ -33,6 +33,6 @@ func (s *Sidecar) SignalProcess() error { return nil } -func validateOSConfig(c *Config) error { +func validateOSConfig(_ *Config) error { return nil } From 507cd3b5cc4f6a2fcb78213aaee3f8e2dbafd71c Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Tue, 16 Jan 2024 10:06:36 -0800 Subject: [PATCH 2/2] Update pkg/sidecar/util_posix.go Co-authored-by: Marcos Yacob Signed-off-by: Faisal Memon --- pkg/sidecar/util_posix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sidecar/util_posix.go b/pkg/sidecar/util_posix.go index 6d8daefc..50665947 100644 --- a/pkg/sidecar/util_posix.go +++ b/pkg/sidecar/util_posix.go @@ -33,6 +33,6 @@ func (s *Sidecar) SignalProcess() error { return nil } -func validateOSConfig(_ *Config) error { +func validateOSConfig(*Config) error { return nil }