Merge pull request #65677 from MorrisLaw/node-controller-logging

Automatic merge from submit-queue (batch tested with PRs 65677, 65711, 65150, 65726). 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>.

Improved logging message for checking if node is shutdown.

**What this PR does / why we need it**:
The previous error message was "Error getting data for node" which was too broad of a message and not very descriptive. This PR will update it to "Error checking if node is shutdown" so that it is more specific.

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-07-03 16:35:05 -07:00 committed by GitHub
commit cf686a4764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -256,7 +256,7 @@ func (cnc *CloudNodeController) MonitorNode() {
// does not delete node from kubernetes cluster when instance it is shutdown see issue #46442
shutdown, err := nodectrlutil.ShutdownInCloudProvider(context.TODO(), cnc.cloud, node)
if err != nil {
glog.Errorf("Error getting data for node %s from cloud: %v", node.Name, err)
glog.Errorf("Error checking if node %s is shutdown: %v", node.Name, err)
}
if shutdown && err == nil {
@ -273,7 +273,7 @@ func (cnc *CloudNodeController) MonitorNode() {
// doesn't, delete the node immediately.
exists, err := ensureNodeExistsByProviderID(instances, node)
if err != nil {
glog.Errorf("Error getting data for node %s from cloud: %v", node.Name, err)
glog.Errorf("Error checking if node %s exists: %v", node.Name, err)
continue
}