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

Function NewWithValues

pkg/node/node.go:114–120  ·  view source on GitHub ↗

NewWithValues will construct a node struct with a drain helper and an uptime function

(nthConfig config.Config, drainHelper *drain.Helper, uptime uptime.UptimeFuncType)

Source from the content-addressed store, hash-verified

112
113// NewWithValues will construct a node struct with a drain helper and an uptime function
114func NewWithValues(nthConfig config.Config, drainHelper *drain.Helper, uptime uptime.UptimeFuncType) (*Node, error) {
115 return &Node{
116 nthConfig: nthConfig,
117 drainHelper: drainHelper,
118 uptime: uptime,
119 }, nil
120}
121
122// CordonAndDrain will cordon the node and evict pods based on the config
123func (n Node) CordonAndDrain(nodeName string, reason string, recorder recorderInterface) error {

Callers 13

TestSetInterruptionTaintFunction · 0.92
getNodeFunction · 0.92
TestSetInterruptionTaintFunction · 0.92
TestSetInterruptionTaintFunction · 0.92
getNodeFunction · 0.92
newNodeFunction · 0.92
NewFunction · 0.85

Calls

no outgoing calls

Tested by 12

TestSetInterruptionTaintFunction · 0.74
getNodeFunction · 0.74
TestSetInterruptionTaintFunction · 0.74
TestSetInterruptionTaintFunction · 0.74
getNodeFunction · 0.74
newNodeFunction · 0.74
getNodeFunction · 0.68