diff --git a/pkg/volume/csi/BUILD b/pkg/volume/csi/BUILD index 0d18e1832fb..0f96d0a94c4 100644 --- a/pkg/volume/csi/BUILD +++ b/pkg/volume/csi/BUILD @@ -88,6 +88,8 @@ go_test( "//staging/src/k8s.io/component-base/featuregate/testing:go_default_library", "//vendor/github.com/container-storage-interface/spec/lib/go/csi:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", + "//vendor/google.golang.org/grpc/codes:go_default_library", + "//vendor/google.golang.org/grpc/status:go_default_library", "//vendor/k8s.io/klog:go_default_library", ], ) diff --git a/pkg/volume/csi/csi_block_test.go b/pkg/volume/csi/csi_block_test.go index e856da79427..04348e9b46f 100644 --- a/pkg/volume/csi/csi_block_test.go +++ b/pkg/volume/csi/csi_block_test.go @@ -18,12 +18,14 @@ package csi import ( "context" - "errors" "fmt" "os" "path/filepath" "testing" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + api "k8s.io/api/core/v1" "k8s.io/api/storage/v1beta1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -299,7 +301,7 @@ func TestBlockMapperSetupDeviceError(t *testing.T) { csiMapper.csiClient = setupClient(t, true) fClient := csiMapper.csiClient.(*fakeCsiDriverClient) - fClient.nodeClient.SetNextError(errors.New("mock final error")) + fClient.nodeClient.SetNextError(status.Error(codes.InvalidArgument, "mock final error")) attachID := getAttachmentName(csiMapper.volumeID, string(csiMapper.driverName), string(nodeName)) attachment := makeTestAttachment(attachID, nodeName, pvName)