TaintSpotItn adds the spot termination notice taint onto a node
(nodeName string, eventID string)
| 452 | |
| 453 | // TaintSpotItn adds the spot termination notice taint onto a node |
| 454 | func (n Node) TaintSpotItn(nodeName string, eventID string) error { |
| 455 | if !n.nthConfig.TaintNode { |
| 456 | return nil |
| 457 | } |
| 458 | |
| 459 | k8sNode, err := n.fetchKubernetesNode(nodeName) |
| 460 | if err != nil { |
| 461 | return fmt.Errorf("unable to fetch kubernetes node from API: %w", err) |
| 462 | } |
| 463 | |
| 464 | if len(eventID) > 63 { |
| 465 | eventID = eventID[:maxTaintValueLength] |
| 466 | } |
| 467 | |
| 468 | return addTaint(k8sNode, n, SpotInterruptionTaint, eventID, n.nthConfig.TaintEffect) |
| 469 | } |
| 470 | |
| 471 | // TaintASGLifecycleTermination adds the spot termination notice taint onto a node |
| 472 | func (n Node) TaintASGLifecycleTermination(nodeName string, eventID string) error { |
no test coverage detected