From 0861688237a724db9512649cdff41b262c9bcd1c Mon Sep 17 00:00:00 2001 From: NickrenREN Date: Wed, 1 Mar 2017 15:29:44 +0800 Subject: [PATCH] add and clear err message in RemoveVolumeFromReportAsAttached --- .../volume/attachdetach/cache/actual_state_of_world.go | 2 +- .../volume/attachdetach/reconciler/reconciler.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go b/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go index db405298221..c1c4ad5d261 100644 --- a/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go +++ b/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go @@ -424,7 +424,7 @@ func (asw *actualStateOfWorld) removeVolumeFromReportAsAttached( return nil } } - return fmt.Errorf("volume %q or node %q does not exist in volumesToReportAsAttached list", + return fmt.Errorf("volume %q does not exist in volumesToReportAsAttached list or node %q does not exist in nodesToUpdateStatusFor list", volumeName, nodeName) diff --git a/pkg/controller/volume/attachdetach/reconciler/reconciler.go b/pkg/controller/volume/attachdetach/reconciler/reconciler.go index 08ce7effc18..5af44bfa647 100644 --- a/pkg/controller/volume/attachdetach/reconciler/reconciler.go +++ b/pkg/controller/volume/attachdetach/reconciler/reconciler.go @@ -150,7 +150,13 @@ func (rc *reconciler) reconcile() { // Before triggering volume detach, mark volume as detached and update the node status // If it fails to update node status, skip detach volume - rc.actualStateOfWorld.RemoveVolumeFromReportAsAttached(attachedVolume.VolumeName, attachedVolume.NodeName) + err = rc.actualStateOfWorld.RemoveVolumeFromReportAsAttached(attachedVolume.VolumeName, attachedVolume.NodeName) + if err != nil { + glog.V(5).Infof("RemoveVolumeFromReportAsAttached failed while removing volume %q from node %q with: %v", + attachedVolume.VolumeName, + attachedVolume.NodeName, + err) + } // Update Node Status to indicate volume is no longer safe to mount. err = rc.nodeStatusUpdater.UpdateNodeStatuses()