mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
fix azure disk data loss issue on Windows
This commit is contained in:
parent
fb3e2c42ef
commit
9e35244c6c
@ -285,6 +285,15 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
|
||||
|
||||
// UnmountDevice unmounts the volume on the node
|
||||
func (d *azureDiskDetacher) UnmountDevice(deviceMountPath string) error {
|
||||
if runtime.GOOS == "windows" {
|
||||
// Flush data cache for windows because it does not do so automatically during unmount device
|
||||
exec := d.plugin.host.GetExec(d.plugin.GetPluginName())
|
||||
err := util.WriteVolumeCache(deviceMountPath, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
err := mount.CleanupMountPoint(deviceMountPath, d.plugin.host.GetMounter(d.plugin.GetPluginName()), false)
|
||||
if err == nil {
|
||||
klog.V(2).Infof("azureDisk - Device %s was unmounted", deviceMountPath)
|
||||
|
Loading…
Reference in New Issue
Block a user