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

Method TaintOutOfService

pkg/node/node.go:550–561  ·  view source on GitHub ↗

TaintOutOfService adds the out-of-service taint (NoExecute) onto a node

(nodeName string)

Source from the content-addressed store, hash-verified

548
549// TaintOutOfService adds the out-of-service taint (NoExecute) onto a node
550func (n Node) TaintOutOfService(nodeName string) error {
551 if !n.nthConfig.EnableOutOfServiceTaint || n.nthConfig.CordonOnly {
552 return nil
553 }
554
555 k8sNode, err := n.fetchKubernetesNode(nodeName)
556 if err != nil {
557 return fmt.Errorf("unable to fetch kubernetes node from API: %w", err)
558 }
559
560 return addTaint(k8sNode, n, OutOfServiceTaintKey, OutOfServiceTaintValue, OutOfServiceTaintEffectType)
561}
562
563// RemoveNTHTaints removes NTH-specific taints from a node
564func (n Node) RemoveNTHTaints(nodeName string) error {

Callers 2

HandleEventMethod · 0.80
TestTaintOutOfServiceFunction · 0.80

Calls 2

fetchKubernetesNodeMethod · 0.95
addTaintFunction · 0.85

Tested by 1

TestTaintOutOfServiceFunction · 0.64