@@ -21,11 +21,9 @@ import (
21
21
"errors"
22
22
"fmt"
23
23
"os"
24
- "runtime"
25
24
26
25
csicommon "sigs.k8s.io/secrets-store-csi-driver/pkg/csi-common"
27
26
internalerrors "sigs.k8s.io/secrets-store-csi-driver/pkg/errors"
28
- "sigs.k8s.io/secrets-store-csi-driver/pkg/util/fileutil"
29
27
30
28
"github.com/container-storage-interface/spec/lib/go/csi"
31
29
"golang.org/x/net/context"
@@ -222,23 +220,11 @@ func (ns *nodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
222
220
return nil , status .Error (codes .InvalidArgument , "Target path missing in request" )
223
221
}
224
222
targetPath := req .GetTargetPath ()
225
- // Assume no mounted files if GetMountedFiles fails.
226
- files , _ := fileutil .GetMountedFiles (targetPath )
227
223
228
224
if isMockTargetPath (targetPath ) {
229
225
return & csi.NodeUnpublishVolumeResponse {}, nil
230
226
}
231
227
232
- // remove files
233
- if runtime .GOOS == "windows" {
234
- for _ , file := range files {
235
- err = os .RemoveAll (file )
236
- if err != nil {
237
- klog .ErrorS (err , "failed to remove file from target path" , "file" , file )
238
- return nil , status .Error (codes .Internal , err .Error ())
239
- }
240
- }
241
- }
242
228
err = mount .CleanupMountPoint (targetPath , ns .mounter , false )
243
229
if err != nil && ! os .IsNotExist (err ) {
244
230
klog .ErrorS (err , "failed to clean and unmount target path" , "targetPath" , targetPath )
0 commit comments