TaintASGLifecycleTermination adds the spot termination notice taint onto a node
(nodeName string, eventID string)
| 470 | |
| 471 | // TaintASGLifecycleTermination adds the spot termination notice taint onto a node |
| 472 | func (n Node) TaintASGLifecycleTermination(nodeName string, eventID string) error { |
| 473 | if !n.nthConfig.TaintNode { |
| 474 | return nil |
| 475 | } |
| 476 | |
| 477 | k8sNode, err := n.fetchKubernetesNode(nodeName) |
| 478 | if err != nil { |
| 479 | return fmt.Errorf("unable to fetch kubernetes node from API: %w", err) |
| 480 | } |
| 481 | |
| 482 | if len(eventID) > 63 { |
| 483 | eventID = eventID[:maxTaintValueLength] |
| 484 | } |
| 485 | |
| 486 | return addTaint(k8sNode, n, ASGLifecycleTerminationTaint, eventID, n.nthConfig.TaintEffect) |
| 487 | } |
| 488 | |
| 489 | // TaintRebalanceRecommendation adds the rebalance recommendation notice taint onto a node |
| 490 | func (n Node) TaintRebalanceRecommendation(nodeName string, eventID string) error { |
no test coverage detected