TaintOutOfService adds the out-of-service taint (NoExecute) onto a node
(nodeName string)
| 548 | |
| 549 | // TaintOutOfService adds the out-of-service taint (NoExecute) onto a node |
| 550 | func (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 |
| 564 | func (n Node) RemoveNTHTaints(nodeName string) error { |