MCPcopy Create free account
hub / github.com/aws/aws-node-termination-handler / TaintSpotItn

Method TaintSpotItn

pkg/node/node.go:454–469  ·  view source on GitHub ↗

TaintSpotItn adds the spot termination notice taint onto a node

(nodeName string, eventID string)

Source from the content-addressed store, hash-verified

452
453// TaintSpotItn adds the spot termination notice taint onto a node
454func (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
472func (n Node) TaintASGLifecycleTermination(nodeName string, eventID string) error {

Callers 2

setInterruptionTaintFunction · 0.80

Calls 2

fetchKubernetesNodeMethod · 0.95
addTaintFunction · 0.85

Tested by

no test coverage detected