From 3372c056cd6074569d80aeb7e42f00684ff9b460 Mon Sep 17 00:00:00 2001 From: carlory Date: Tue, 27 Aug 2024 00:56:36 +0800 Subject: [PATCH] fix linter hints --- pkg/kubelet/cm/dra/plugin/plugin_test.go | 10 ++++++++-- pkg/kubelet/cm/dra/plugin/registration_test.go | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/kubelet/cm/dra/plugin/plugin_test.go b/pkg/kubelet/cm/dra/plugin/plugin_test.go index d78ed6bd393..12219e06517 100644 --- a/pkg/kubelet/cm/dra/plugin/plugin_test.go +++ b/pkg/kubelet/cm/dra/plugin/plugin_test.go @@ -69,7 +69,9 @@ func setupFakeGRPCServer(version string) (string, tearDown, error) { addr := filepath.Join(p, "server.sock") teardown := func() { close(closeCh) - os.RemoveAll(addr) + if err := os.RemoveAll(addr); err != nil { + panic(err) + } } listener, err := net.Listen("unix", addr) @@ -88,7 +90,11 @@ func setupFakeGRPCServer(version string) (string, tearDown, error) { } go func() { - go s.Serve(listener) + go func() { + if err := s.Serve(listener); err != nil { + panic(err) + } + }() <-closeCh s.GracefulStop() }() diff --git a/pkg/kubelet/cm/dra/plugin/registration_test.go b/pkg/kubelet/cm/dra/plugin/registration_test.go index 7495a4d7751..91258be8e69 100644 --- a/pkg/kubelet/cm/dra/plugin/registration_test.go +++ b/pkg/kubelet/cm/dra/plugin/registration_test.go @@ -78,7 +78,7 @@ func TestRegistrationHandler_ValidatePlugin(t *testing.T) { if test.shouldError { assert.Error(t, err) } else { - assert.Nil(t, err) + assert.NoError(t, err) } }) }