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

Method RemoveNTHTaints

pkg/node/node.go:564–584  ·  view source on GitHub ↗

RemoveNTHTaints removes NTH-specific taints from a node

(nodeName string)

Source from the content-addressed store, hash-verified

562
563// RemoveNTHTaints removes NTH-specific taints from a node
564func (n Node) RemoveNTHTaints(nodeName string) error {
565 if !n.nthConfig.TaintNode {
566 return nil
567 }
568
569 k8sNode, err := n.fetchKubernetesNode(nodeName)
570 if err != nil {
571 return fmt.Errorf("unable to fetch kubernetes node from API: %w", err)
572 }
573
574 taints := []string{SpotInterruptionTaint, ScheduledMaintenanceTaint, ASGLifecycleTerminationTaint, RebalanceRecommendationTaint}
575
576 for _, taint := range taints {
577 _, err = removeTaint(k8sNode, n.drainHelper.Client, taint)
578 if err != nil {
579 return fmt.Errorf("unable to clean taint %s from node %s", taint, nodeName)
580 }
581 }
582
583 return nil
584}
585
586// IsLabeledWithAction will return true if the current node is labeled with NTH action labels
587func (n Node) IsLabeledWithAction(nodeName string) (bool, error) {

Callers 2

UncordonIfRebootedMethod · 0.95

Calls 2

fetchKubernetesNodeMethod · 0.95
removeTaintFunction · 0.85

Tested by

no test coverage detected