Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CSI mounter.TearDownAt log msg #105136

Merged
merged 1 commit into from
Oct 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/volume/csi/csi_mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,20 +364,20 @@ func (c *csiMountMgr) TearDown() error {
return c.TearDownAt(c.GetPath())
}
func (c *csiMountMgr) TearDownAt(dir string) error {
klog.V(4).Infof(log("Unmounter.TearDown(%s)", dir))
klog.V(4).Infof(log("Unmounter.TearDownAt(%s)", dir))

volID := c.volumeID
csi, err := c.csiClientGetter.Get()
if err != nil {
return errors.New(log("mounter.SetUpAt failed to get CSI client: %v", err))
return errors.New(log("Unmounter.TearDownAt failed to get CSI client: %v", err))
}

// Could not get spec info on whether this is a migrated operation because c.spec is nil
ctx, cancel := createCSIOperationContext(c.spec, csiTimeout)
defer cancel()

if err := csi.NodeUnpublishVolume(ctx, volID, dir); err != nil {
return errors.New(log("mounter.TearDownAt failed: %v", err))
return errors.New(log("Unmounter.TearDownAt failed: %v", err))
}

// Deprecation: Removal of target_path provided in the NodePublish RPC call
Expand All @@ -386,9 +386,9 @@ func (c *csiMountMgr) TearDownAt(dir string) error {
// by the kubelet in the future. Kubelet will only be responsible for
// removal of json data files it creates and parent directories.
if err := removeMountDir(c.plugin, dir); err != nil {
return errors.New(log("mounter.TearDownAt failed to clean mount dir [%s]: %v", dir, err))
return errors.New(log("Unmounter.TearDownAt failed to clean mount dir [%s]: %v", dir, err))
}
klog.V(4).Infof(log("mounter.TearDownAt successfully unmounted dir [%s]", dir))
klog.V(4).Infof(log("Unmounter.TearDownAt successfully unmounted dir [%s]", dir))

return nil
}
Expand Down