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

Function New

pkg/node/node.go:105–111  ·  view source on GitHub ↗

New will construct a node struct to perform various node function through the kubernetes api server

(nthConfig config.Config, clientset *kubernetes.Clientset)

Source from the content-addressed store, hash-verified

103
104// New will construct a node struct to perform various node function through the kubernetes api server
105func New(nthConfig config.Config, clientset *kubernetes.Clientset) (*Node, error) {
106 drainHelper, err := getDrainHelper(nthConfig, clientset)
107 if err != nil {
108 return nil, err
109 }
110 return NewWithValues(nthConfig, drainHelper, getUptimeFunc(nthConfig.UptimeFromFile))
111}
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) {

Callers 2

heartbeatTestHelperFunction · 0.92
mainFunction · 0.92

Calls 3

NewWithValuesFunction · 0.85
getUptimeFuncFunction · 0.85
getDrainHelperFunction · 0.70

Tested by 1

heartbeatTestHelperFunction · 0.74