Skip to content

Commit

Permalink
Error log fix (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
LikithaVemulapalli authored Jan 23, 2023
1 parent f0892cc commit 2fb865f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ func (n Node) fetchKubernetesNode(nodeName string) (*corev1.Node, error) {
listOptions := metav1.ListOptions{LabelSelector: labels.Set(labelSelector.MatchLabels).String()}
matchingNodes, err := n.drainHelper.Client.CoreV1().Nodes().List(context.TODO(), listOptions)
if err != nil || len(matchingNodes.Items) == 0 {
log.Err(err).Msgf("Error when trying to list Nodes w/ label, falling back to direct Get lookup of node")
log.Warn().Msgf("Unable to list Nodes w/ label, falling back to direct Get lookup of node")
return n.drainHelper.Client.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{})
}
return &matchingNodes.Items[0], nil
Expand Down

0 comments on commit 2fb865f

Please sign in to comment.