From a4031a971c8422a09829a56a3a1ce59fe2f10291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20W=C3=B6hrl?= Date: Sun, 3 Mar 2024 22:53:11 +0100 Subject: [PATCH] skip invalid mountpoints on unpublish request --- cmd/plugin/node_server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/plugin/node_server.go b/cmd/plugin/node_server.go index b651a3f..c81ecd0 100644 --- a/cmd/plugin/node_server.go +++ b/cmd/plugin/node_server.go @@ -191,6 +191,11 @@ func (n NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpubl } mnt, err := n.k8smounter.IsMountPoint(req.TargetPath) + if !mnt || !os.IsNotExist(err) { + klog.Warningf("mount cleanup skipped: %s is not a mount point", req.TargetPath) + return &csi.NodeUnpublishVolumeResponse{}, nil + } + if err != nil || !mnt { return &csi.NodeUnpublishVolumeResponse{}, err }