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

Method TaintScheduledMaintenance

pkg/node/node.go:532–547  ·  view source on GitHub ↗

TaintScheduledMaintenance adds the scheduled maintenance taint onto a node

(nodeName string, eventID string)

Source from the content-addressed store, hash-verified

530
531// TaintScheduledMaintenance adds the scheduled maintenance taint onto a node
532func (n Node) TaintScheduledMaintenance(nodeName string, eventID string) error {
533 if !n.nthConfig.TaintNode {
534 return nil
535 }
536
537 k8sNode, err := n.fetchKubernetesNode(nodeName)
538 if err != nil {
539 return fmt.Errorf("unable to fetch kubernetes node from API: %w", err)
540 }
541
542 if len(eventID) > 63 {
543 eventID = eventID[:maxTaintValueLength]
544 }
545
546 return addTaint(k8sNode, n, ScheduledMaintenanceTaint, eventID, n.nthConfig.TaintEffect)
547}
548
549// TaintOutOfService adds the out-of-service taint (NoExecute) onto a node
550func (n Node) TaintOutOfService(nodeName string) error {

Calls 2

fetchKubernetesNodeMethod · 0.95
addTaintFunction · 0.85

Tested by

no test coverage detected