New will construct a node struct to perform various node function through the kubernetes api server
(nthConfig config.Config, clientset *kubernetes.Clientset)
| 103 | |
| 104 | // New will construct a node struct to perform various node function through the kubernetes api server |
| 105 | func 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 |
| 114 | func NewWithValues(nthConfig config.Config, drainHelper *drain.Helper, uptime uptime.UptimeFuncType) (*Node, error) { |