IsUnschedulable checks if the node is marked as unschedulable
(nodeName string)
| 212 | |
| 213 | // IsUnschedulable checks if the node is marked as unschedulable |
| 214 | func (n Node) IsUnschedulable(nodeName string) (bool, error) { |
| 215 | if n.nthConfig.DryRun { |
| 216 | log.Info().Msg("IsUnschedulable returning false since dry-run is set") |
| 217 | return false, nil |
| 218 | } |
| 219 | node, err := n.fetchKubernetesNode(nodeName) |
| 220 | if err != nil { |
| 221 | return true, err |
| 222 | } |
| 223 | return node.Spec.Unschedulable, nil |
| 224 | } |
| 225 | |
| 226 | // MarkWithEventID will add the drain event ID to the node to be properly ignored after a system restart event |
| 227 | func (n Node) MarkWithEventID(nodeName string, eventID string) error { |