mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
RBD Plugin: Log RBD Attach/Mount/Unmout actions at logging level 3
This commit is contained in:
parent
07dea6b447
commit
c648505f76
@ -77,6 +77,7 @@ func diskSetUp(manager diskManager, b rbdMounter, volPath string, mounter mount.
|
|||||||
glog.Errorf("failed to bind mount:%s", globalPDPath)
|
glog.Errorf("failed to bind mount:%s", globalPDPath)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
glog.V(3).Infof("rbd: successfully bind mount %s to %s with options %v", globalPDPath, volPath, mountOptions)
|
||||||
|
|
||||||
if !b.ReadOnly {
|
if !b.ReadOnly {
|
||||||
volume.SetVolumeOwnership(&b, fsGroup)
|
volume.SetVolumeOwnership(&b, fsGroup)
|
||||||
|
@ -312,12 +312,14 @@ func (util *RBDUtil) AttachDisk(b rbdMounter) error {
|
|||||||
if !found {
|
if !found {
|
||||||
return errors.New("Could not map image: Timeout after 10s")
|
return errors.New("Could not map image: Timeout after 10s")
|
||||||
}
|
}
|
||||||
|
glog.V(3).Infof("rbd: successfully map image %s/%s to %s", b.Pool, b.Image, devicePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// mount it
|
// mount it
|
||||||
if err = b.mounter.FormatAndMount(devicePath, globalPDPath, b.fsType, nil); err != nil {
|
if err = b.mounter.FormatAndMount(devicePath, globalPDPath, b.fsType, nil); err != nil {
|
||||||
err = fmt.Errorf("rbd: failed to mount rbd volume %s [%s] to %s, error %v", devicePath, b.fsType, globalPDPath, err)
|
err = fmt.Errorf("rbd: failed to mount rbd volume %s [%s] to %s, error %v", devicePath, b.fsType, globalPDPath, err)
|
||||||
}
|
}
|
||||||
|
glog.V(3).Infof("rbd: successfully mount image %s/%s at %s", b.Pool, b.Image, globalPDPath)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,6 +331,7 @@ func (util *RBDUtil) DetachDisk(c rbdUnmounter, mntPath string) error {
|
|||||||
if err = c.mounter.Unmount(mntPath); err != nil {
|
if err = c.mounter.Unmount(mntPath); err != nil {
|
||||||
return fmt.Errorf("rbd detach disk: failed to umount: %s\nError: %v", mntPath, err)
|
return fmt.Errorf("rbd detach disk: failed to umount: %s\nError: %v", mntPath, err)
|
||||||
}
|
}
|
||||||
|
glog.V(3).Infof("rbd: successfully umount mountpoint %s", mntPath)
|
||||||
// if device is no longer used, see if can unmap
|
// if device is no longer used, see if can unmap
|
||||||
if cnt <= 1 {
|
if cnt <= 1 {
|
||||||
// rbd unmap
|
// rbd unmap
|
||||||
@ -343,7 +346,7 @@ func (util *RBDUtil) DetachDisk(c rbdUnmounter, mntPath string) error {
|
|||||||
util.defencing(c)
|
util.defencing(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.Infof("rbd: successfully unmap device %s", device)
|
glog.V(3).Infof("rbd: successfully unmap device %s", device)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user