Skip to content

Commit

Permalink
Merge pull request kubernetes#123834 from alvaroaleman/emit-err
Browse files Browse the repository at this point in the history
Nodelifecycle: Emit event when deletion failed
  • Loading branch information
k8s-ci-robot authored Apr 18, 2024
2 parents d9d6986 + b2eb6e7 commit e43015a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ import (
)

const (
deleteNodeEvent = "DeletingNode"
deleteNodeEvent = "DeletingNode"
deleteNodeFailedEvent = "DeletingNodeFailed"
)

var ShutdownTaint = &v1.Taint{
Expand Down Expand Up @@ -175,6 +176,8 @@ func (c *CloudNodeLifecycleController) MonitorNodes(ctx context.Context) {

if err := c.kubeClient.CoreV1().Nodes().Delete(ctx, node.Name, metav1.DeleteOptions{}); err != nil {
klog.Errorf("unable to delete node %q: %v", node.Name, err)
c.recorder.Eventf(ref, v1.EventTypeWarning, deleteNodeFailedEvent,
"Failed deleting node %s: %v", node.Name, err)
}
} else {
// Node exists. We need to check this to get taint working in similar in all cloudproviders
Expand Down

0 comments on commit e43015a

Please sign in to comment.