IsLabeledWithAction will return true if the current node is labeled with NTH action labels
(nodeName string)
| 585 | |
| 586 | // IsLabeledWithAction will return true if the current node is labeled with NTH action labels |
| 587 | func (n Node) IsLabeledWithAction(nodeName string) (bool, error) { |
| 588 | k8sNode, err := n.fetchKubernetesNode(nodeName) |
| 589 | if err != nil { |
| 590 | return false, fmt.Errorf("unable to fetch kubernetes node from API: %w", err) |
| 591 | } |
| 592 | _, actionLabelOK := k8sNode.Labels[ActionLabelKey] |
| 593 | _, eventIDLabelOK := k8sNode.Labels[EventIDLabelKey] |
| 594 | return actionLabelOK && eventIDLabelOK, nil |
| 595 | } |
| 596 | |
| 597 | // UncordonIfRebooted will check for node labels to trigger an uncordon because of a system-reboot scheduled event |
| 598 | func (n Node) UncordonIfRebooted(nodeName string) error { |