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

Method Uncordon

pkg/node/node.go:197–211  ·  view source on GitHub ↗

Uncordon will remove the NoSchedule on the node

(nodeName string)

Source from the content-addressed store, hash-verified

195
196// Uncordon will remove the NoSchedule on the node
197func (n Node) Uncordon(nodeName string) error {
198 if n.nthConfig.DryRun {
199 log.Info().Str("node_name", nodeName).Msg("Node would have been uncordoned, but dry-run flag was set")
200 return nil
201 }
202 node, err := n.fetchKubernetesNode(nodeName)
203 if err != nil {
204 return fmt.Errorf("there was an error fetching the node in preparation for uncordoning: %w", err)
205 }
206 err = drain.RunCordonOrUncordon(n.drainHelper, node, false)
207 if err != nil {
208 return err
209 }
210 return nil
211}
212
213// IsUnschedulable checks if the node is marked as unschedulable
214func (n Node) IsUnschedulable(nodeName string) (bool, error) {

Callers 5

UncordonIfRebootedMethod · 0.95
TestDryRunFunction · 0.80
TestUncordonSuccessFunction · 0.80
TestUncordonFailureFunction · 0.80

Calls 1

fetchKubernetesNodeMethod · 0.95

Tested by 3

TestDryRunFunction · 0.64
TestUncordonSuccessFunction · 0.64
TestUncordonFailureFunction · 0.64