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

Method IsUnschedulable

pkg/node/node.go:214–224  ·  view source on GitHub ↗

IsUnschedulable checks if the node is marked as unschedulable

(nodeName string)

Source from the content-addressed store, hash-verified

212
213// IsUnschedulable checks if the node is marked as unschedulable
214func (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
227func (n Node) MarkWithEventID(nodeName string, eventID string) error {

Callers 4

TestDryRunFunction · 0.80

Calls 1

fetchKubernetesNodeMethod · 0.95

Tested by 3

TestDryRunFunction · 0.64