RemoveNTHTaints removes NTH-specific taints from a node
(nodeName string)
| 562 | |
| 563 | // RemoveNTHTaints removes NTH-specific taints from a node |
| 564 | func (n Node) RemoveNTHTaints(nodeName string) error { |
| 565 | if !n.nthConfig.TaintNode { |
| 566 | return nil |
| 567 | } |
| 568 | |
| 569 | k8sNode, err := n.fetchKubernetesNode(nodeName) |
| 570 | if err != nil { |
| 571 | return fmt.Errorf("unable to fetch kubernetes node from API: %w", err) |
| 572 | } |
| 573 | |
| 574 | taints := []string{SpotInterruptionTaint, ScheduledMaintenanceTaint, ASGLifecycleTerminationTaint, RebalanceRecommendationTaint} |
| 575 | |
| 576 | for _, taint := range taints { |
| 577 | _, err = removeTaint(k8sNode, n.drainHelper.Client, taint) |
| 578 | if err != nil { |
| 579 | return fmt.Errorf("unable to clean taint %s from node %s", taint, nodeName) |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | return nil |
| 584 | } |
| 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) { |
no test coverage detected