MCPcopy Index your code
hub / github.com/aws/aws-node-termination-handler / TaintASGLifecycleTermination

Method TaintASGLifecycleTermination

pkg/node/node.go:472–487  ·  view source on GitHub ↗

TaintASGLifecycleTermination adds the spot termination notice taint onto a node

(nodeName string, eventID string)

Source from the content-addressed store, hash-verified

470
471// TaintASGLifecycleTermination adds the spot termination notice taint onto a node
472func (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
490func (n Node) TaintRebalanceRecommendation(nodeName string, eventID string) error {

Callers 2

setInterruptionTaintFunction · 0.80

Calls 2

fetchKubernetesNodeMethod · 0.95
addTaintFunction · 0.85

Tested by

no test coverage detected