From a4c1f2f2ab80aab174ca3709b84e843a443bf8a4 Mon Sep 17 00:00:00 2001 From: Guilhem Lettron Date: Tue, 11 Mar 2025 14:45:51 +0100 Subject: [PATCH] chore: return notFound when disk isn't attached https://github.com/kubernetes-sigs/vsphere-csi-driver/blob/5a645a4b2fe29a52bba3305365c5918d049f1cf0/pkg/csi/service/osutils/linux_os_utils.go#L870 --- internal/driver/nodeserver_helpers.go | 2 +- internal/driver/nodeserver_helpers_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/driver/nodeserver_helpers.go b/internal/driver/nodeserver_helpers.go index 5829b365..120a7aef 100644 --- a/internal/driver/nodeserver_helpers.go +++ b/internal/driver/nodeserver_helpers.go @@ -179,7 +179,7 @@ func (ns *NodeServer) findDevicePath(ctx context.Context, key linodevolumes.Lino // If no device path is found, return an error. if devicePath == "" { - return "", errInternal("Unable to find device path out of attempted paths: %v", devicePaths) + return "", errNotFound("Unable to find device path out of attempted paths: %v", devicePaths) } // If a device path is found, return it. diff --git a/internal/driver/nodeserver_helpers_test.go b/internal/driver/nodeserver_helpers_test.go index 169fef37..33a9d09c 100644 --- a/internal/driver/nodeserver_helpers_test.go +++ b/internal/driver/nodeserver_helpers_test.go @@ -225,7 +225,7 @@ func TestNodeServer_findDevicePath(t *testing.T) { dUtils.EXPECT().VerifyDevicePath(gomock.Any()).Return("", nil) }, wantDevicePath: "", - wantErr: errInternal("Unable to find device path out of attempted paths: [some/path]"), + wantErr: errNotFound("Unable to find device path out of attempted paths: [some/path]"), }, { name: "Success",