Merge pull request #60189 from jeffrey4l/log_warning

Automatic merge from submit-queue (batch tested with PRs 60189, 59542, 59931, 60621, 60353). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Log warning message when failed to remove rbd lock

It is hard to debug without any error message when lock is not removed
successfully.
This commit is contained in:
Kubernetes Submit Queue 2018-03-20 00:42:06 -07:00 committed by GitHub
commit ffe3bb2567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -346,6 +346,8 @@ func (util *RBDUtil) rbdUnlock(b rbdMounter) error {
cmd, err = b.exec.Run("rbd", args...) cmd, err = b.exec.Run("rbd", args...)
if err == nil { if err == nil {
glog.V(4).Infof("rbd: successfully remove lock (locker_id: %s) on image: %s/%s with id %s mon %s", lock_id, b.Pool, b.Image, b.Id, mon) glog.V(4).Infof("rbd: successfully remove lock (locker_id: %s) on image: %s/%s with id %s mon %s", lock_id, b.Pool, b.Image, b.Id, mon)
} else {
glog.Warningf("rbd: failed to remove lock (lock_id: %s) on image: %s/%s with id %s mon %s: %v", lock_id, b.Pool, b.Image, b.Id, mon, err)
} }
} }