From e198938671c35d1f9024ba8ce80bae9c863f74a8 Mon Sep 17 00:00:00 2001 From: carlory Date: Tue, 30 Jan 2024 18:47:49 +0800 Subject: [PATCH] Remove deprecated comment about cleanup the target_path of CSI volumes --- pkg/volume/csi/csi_mounter.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/volume/csi/csi_mounter.go b/pkg/volume/csi/csi_mounter.go index a1afdfa2173..21cdf29807b 100644 --- a/pkg/volume/csi/csi_mounter.go +++ b/pkg/volume/csi/csi_mounter.go @@ -434,11 +434,16 @@ func (c *csiMountMgr) TearDownAt(dir string) error { return errors.New(log("Unmounter.TearDownAt failed: %v", err)) } - // Deprecation: Removal of target_path provided in the NodePublish RPC call + // Removal of target_path provided in the NodePublish RPC call // (in this case location `dir`) MUST be done by the CSI plugin according - // to the spec. This will no longer be done directly as part of TearDown - // by the kubelet in the future. Kubelet will only be responsible for - // removal of json data files it creates and parent directories. + // to the spec. + // + // Kubelet should only be responsible for removal of json data files it + // creates and parent directories. + // + // However, some CSI plugins maybe buggy and don't adhere to the standard, + // so we still need to remove the target_path here if it's unmounted and + // empty. if err := removeMountDir(c.plugin, dir); err != nil { return errors.New(log("Unmounter.TearDownAt failed to clean mount dir [%s]: %v", dir, err)) }