2018-01-24 13:01:37 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
2018-03-21 17:05:37 +00:00
|
|
|
"fmt"
|
2018-01-24 13:01:37 +00:00
|
|
|
"log"
|
2018-02-12 23:15:15 +00:00
|
|
|
"sync"
|
2018-01-24 13:01:37 +00:00
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/hashicorp/nomad/client/config"
|
|
|
|
"github.com/hashicorp/nomad/client/driver"
|
|
|
|
"github.com/hashicorp/nomad/client/fingerprint"
|
|
|
|
cstructs "github.com/hashicorp/nomad/client/structs"
|
|
|
|
"github.com/hashicorp/nomad/nomad/structs"
|
|
|
|
)
|
|
|
|
|
|
|
|
// FingerprintManager runs a client fingerprinters on a continuous basis, and
|
|
|
|
// updates the client when the node has changed
|
|
|
|
type FingerprintManager struct {
|
2018-02-05 17:20:07 +00:00
|
|
|
getConfig func() *config.Config
|
|
|
|
node *structs.Node
|
2018-02-12 23:15:15 +00:00
|
|
|
nodeLock sync.Mutex
|
2018-02-05 17:20:07 +00:00
|
|
|
shutdownCh chan struct{}
|
|
|
|
|
2018-01-25 16:30:15 +00:00
|
|
|
// updateNodeAttributes is a callback to the client to update the state of its
|
2018-02-05 17:20:07 +00:00
|
|
|
// associated node
|
2018-01-25 16:30:15 +00:00
|
|
|
updateNodeAttributes func(*cstructs.FingerprintResponse) *structs.Node
|
|
|
|
|
2018-03-19 12:06:09 +00:00
|
|
|
// updateNodeFromDriver is a callback to the client to update the state of a
|
|
|
|
// specific driver for the node
|
2018-03-09 17:28:01 +00:00
|
|
|
updateNodeFromDriver func(string, *structs.DriverInfo, *structs.DriverInfo) *structs.Node
|
|
|
|
logger *log.Logger
|
2018-01-24 13:01:37 +00:00
|
|
|
}
|
|
|
|
|
2018-02-05 23:02:52 +00:00
|
|
|
// NewFingerprintManager is a constructor that creates and returns an instance
|
|
|
|
// of FingerprintManager
|
|
|
|
func NewFingerprintManager(getConfig func() *config.Config,
|
|
|
|
node *structs.Node,
|
|
|
|
shutdownCh chan struct{},
|
2018-01-25 16:30:15 +00:00
|
|
|
updateNodeAttributes func(*cstructs.FingerprintResponse) *structs.Node,
|
2018-03-09 17:28:01 +00:00
|
|
|
updateNodeFromDriver func(string, *structs.DriverInfo, *structs.DriverInfo) *structs.Node,
|
2018-02-05 23:02:52 +00:00
|
|
|
logger *log.Logger) *FingerprintManager {
|
|
|
|
return &FingerprintManager{
|
2018-01-25 16:30:15 +00:00
|
|
|
getConfig: getConfig,
|
|
|
|
updateNodeAttributes: updateNodeAttributes,
|
2018-03-09 17:28:01 +00:00
|
|
|
updateNodeFromDriver: updateNodeFromDriver,
|
2018-01-25 16:30:15 +00:00
|
|
|
node: node,
|
|
|
|
shutdownCh: shutdownCh,
|
|
|
|
logger: logger,
|
2018-02-05 23:02:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-10 17:52:43 +00:00
|
|
|
// setNode updates the current client node
|
|
|
|
func (fm *FingerprintManager) setNode(node *structs.Node) {
|
|
|
|
fm.nodeLock.Lock()
|
|
|
|
defer fm.nodeLock.Unlock()
|
|
|
|
|
|
|
|
fm.node = node
|
|
|
|
}
|
|
|
|
|
2018-03-19 16:50:18 +00:00
|
|
|
// Run starts the process of fingerprinting the node. It does an initial pass,
|
|
|
|
// identifying whitelisted and blacklisted fingerprints/drivers. Then, for
|
|
|
|
// those which require periotic checking, it starts a periodic process for
|
|
|
|
// each.
|
|
|
|
func (fp *FingerprintManager) Run() error {
|
|
|
|
// First, set up all fingerprints
|
|
|
|
cfg := fp.getConfig()
|
|
|
|
whitelistFingerprints := cfg.ReadStringListToMap("fingerprint.whitelist")
|
|
|
|
whitelistFingerprintsEnabled := len(whitelistFingerprints) > 0
|
|
|
|
blacklistFingerprints := cfg.ReadStringListToMap("fingerprint.blacklist")
|
2018-01-24 13:01:37 +00:00
|
|
|
|
2018-03-19 16:50:18 +00:00
|
|
|
fp.logger.Printf("[DEBUG] client.fingerprint_manager: built-in fingerprints: %v", fingerprint.BuiltinFingerprints())
|
2018-03-09 17:28:01 +00:00
|
|
|
|
2018-03-19 16:50:18 +00:00
|
|
|
var availableFingerprints []string
|
|
|
|
var skippedFingerprints []string
|
|
|
|
for _, name := range fingerprint.BuiltinFingerprints() {
|
|
|
|
// Skip modules that are not in the whitelist if it is enabled.
|
|
|
|
if _, ok := whitelistFingerprints[name]; whitelistFingerprintsEnabled && !ok {
|
|
|
|
skippedFingerprints = append(skippedFingerprints, name)
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
// Skip modules that are in the blacklist
|
|
|
|
if _, ok := blacklistFingerprints[name]; ok {
|
|
|
|
skippedFingerprints = append(skippedFingerprints, name)
|
|
|
|
continue
|
|
|
|
}
|
2018-03-09 17:28:01 +00:00
|
|
|
|
2018-03-19 16:50:18 +00:00
|
|
|
availableFingerprints = append(availableFingerprints, name)
|
|
|
|
}
|
2018-01-24 13:01:37 +00:00
|
|
|
|
2018-03-19 16:50:18 +00:00
|
|
|
if err := fp.setupFingerprinters(availableFingerprints); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(skippedFingerprints) != 0 {
|
|
|
|
fp.logger.Printf("[DEBUG] client.fingerprint_manager: fingerprint modules skipped due to white/blacklist: %v", skippedFingerprints)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Next, set up drivers
|
|
|
|
// Build the white/blacklists of drivers.
|
|
|
|
whitelistDrivers := cfg.ReadStringListToMap("driver.whitelist")
|
|
|
|
whitelistDriversEnabled := len(whitelistDrivers) > 0
|
|
|
|
blacklistDrivers := cfg.ReadStringListToMap("driver.blacklist")
|
|
|
|
|
|
|
|
var availDrivers []string
|
|
|
|
var skippedDrivers []string
|
|
|
|
|
|
|
|
for name := range driver.BuiltinDrivers {
|
|
|
|
// Skip fingerprinting drivers that are not in the whitelist if it is
|
|
|
|
// enabled.
|
|
|
|
if _, ok := whitelistDrivers[name]; whitelistDriversEnabled && !ok {
|
|
|
|
skippedDrivers = append(skippedDrivers, name)
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
// Skip fingerprinting drivers that are in the blacklist
|
|
|
|
if _, ok := blacklistDrivers[name]; ok {
|
|
|
|
skippedDrivers = append(skippedDrivers, name)
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
availDrivers = append(availDrivers, name)
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := fp.setupDrivers(availDrivers); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(skippedDrivers) > 0 {
|
|
|
|
fp.logger.Printf("[DEBUG] client.fingerprint_manager: drivers skipped due to white/blacklist: %v", skippedDrivers)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// setupFingerprints is used to fingerprint the node to see if these attributes are
|
|
|
|
// supported
|
|
|
|
func (fm *FingerprintManager) setupFingerprinters(fingerprints []string) error {
|
|
|
|
var appliedFingerprints []string
|
|
|
|
|
|
|
|
for _, name := range fingerprints {
|
|
|
|
f, err := fingerprint.NewFingerprint(name, fm.logger)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
fm.logger.Printf("[ERR] client.fingerprint_manager: fingerprinting for %v failed: %+v", name, err)
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
detected, err := fm.fingerprint(name, f)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
// log the fingerprinters which have been applied
|
|
|
|
if detected {
|
|
|
|
appliedFingerprints = append(appliedFingerprints, name)
|
|
|
|
}
|
|
|
|
|
|
|
|
p, period := f.Periodic()
|
|
|
|
if p {
|
|
|
|
go fm.runFingerprint(f, period, name)
|
2018-01-24 13:01:37 +00:00
|
|
|
}
|
|
|
|
}
|
2018-03-19 16:50:18 +00:00
|
|
|
|
|
|
|
fm.logger.Printf("[DEBUG] client.fingerprint_manager: detected fingerprints %v", appliedFingerprints)
|
|
|
|
return nil
|
2018-01-24 13:01:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// setupDrivers is used to fingerprint the node to see if these drivers are
|
|
|
|
// supported
|
2018-02-05 23:02:52 +00:00
|
|
|
func (fm *FingerprintManager) setupDrivers(drivers []string) error {
|
2018-01-24 13:01:37 +00:00
|
|
|
var availDrivers []string
|
|
|
|
driverCtx := driver.NewDriverContext("", "", fm.getConfig(), fm.node, fm.logger, nil)
|
|
|
|
for _, name := range drivers {
|
|
|
|
|
|
|
|
d, err := driver.NewDriver(name, driverCtx)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2018-04-10 19:02:24 +00:00
|
|
|
// Pass true for whether the health check is periodic here, so that the
|
|
|
|
// fingerprinter will not set the initial health check status (this is set
|
|
|
|
// below, with an empty health status so that a node event is not
|
|
|
|
// triggered)
|
|
|
|
// Later, the periodic health checker will update this value for drivers
|
|
|
|
// where health checks are enabled.
|
|
|
|
detected, err := fm.fingerprintDriver(name, d, true)
|
2018-01-24 13:01:37 +00:00
|
|
|
if err != nil {
|
2018-03-19 12:06:09 +00:00
|
|
|
fm.logger.Printf("[DEBUG] client.fingerprint_manager: fingerprinting driver %v failed: %+v", name, err)
|
2018-01-24 13:01:37 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2018-03-20 21:56:49 +00:00
|
|
|
// Start a periodic watcher to detect changes to a drivers health and
|
|
|
|
// attributes.
|
2018-03-09 17:28:01 +00:00
|
|
|
go fm.watchDriver(d, name)
|
2018-03-07 15:31:47 +00:00
|
|
|
|
2018-03-19 12:06:09 +00:00
|
|
|
// Log the fingerprinters which have been applied
|
2018-03-09 17:28:01 +00:00
|
|
|
if detected {
|
|
|
|
availDrivers = append(availDrivers, name)
|
2018-01-24 13:01:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-05 23:02:52 +00:00
|
|
|
fm.logger.Printf("[DEBUG] client.fingerprint_manager: detected drivers %v", availDrivers)
|
2018-01-24 13:01:37 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-03-19 16:50:18 +00:00
|
|
|
// runFingerprint runs each fingerprinter individually on an ongoing basis
|
|
|
|
func (fm *FingerprintManager) runFingerprint(f fingerprint.Fingerprint, period time.Duration, name string) {
|
|
|
|
fm.logger.Printf("[DEBUG] client.fingerprint_manager: fingerprinting %s every %v", name, period)
|
|
|
|
|
|
|
|
timer := time.NewTimer(period)
|
|
|
|
defer timer.Stop()
|
|
|
|
|
|
|
|
for {
|
|
|
|
select {
|
|
|
|
case <-timer.C:
|
|
|
|
timer.Reset(period)
|
|
|
|
|
|
|
|
_, err := fm.fingerprint(name, f)
|
|
|
|
if err != nil {
|
|
|
|
fm.logger.Printf("[DEBUG] client.fingerprint_manager: periodic fingerprinting for %v failed: %+v", name, err)
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
case <-fm.shutdownCh:
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// fingerprint does an initial fingerprint of the client. If the fingerprinter
|
|
|
|
// is meant to be run continuously, a process is launched to perform this
|
|
|
|
// fingerprint on an ongoing basis in the background.
|
|
|
|
func (fm *FingerprintManager) fingerprint(name string, f fingerprint.Fingerprint) (bool, error) {
|
|
|
|
var response cstructs.FingerprintResponse
|
|
|
|
|
|
|
|
fm.nodeLock.Lock()
|
|
|
|
request := &cstructs.FingerprintRequest{Config: fm.getConfig(), Node: fm.node}
|
|
|
|
err := f.Fingerprint(request, &response)
|
|
|
|
fm.nodeLock.Unlock()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
|
|
|
|
if node := fm.updateNodeAttributes(&response); node != nil {
|
2018-04-10 17:52:43 +00:00
|
|
|
fm.setNode(node)
|
2018-03-19 16:50:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return response.Detected, nil
|
|
|
|
}
|
|
|
|
|
2018-03-09 17:28:01 +00:00
|
|
|
// watchDrivers facilitates the different periods between fingerprint and
|
|
|
|
// health checking a driver
|
|
|
|
func (fm *FingerprintManager) watchDriver(d driver.Driver, name string) {
|
2018-03-20 21:56:49 +00:00
|
|
|
var fingerprintTicker, healthTicker <-chan time.Time
|
|
|
|
|
|
|
|
// Determine whether the fingerprinter is periodic and health checking
|
2018-03-19 12:06:09 +00:00
|
|
|
isPeriodic, fingerprintPeriod := d.Periodic()
|
2018-03-20 21:56:49 +00:00
|
|
|
hc, isHealthCheck := d.(fingerprint.HealthCheck)
|
|
|
|
|
|
|
|
// Nothing to do since the state of this driver will never change
|
|
|
|
if !isPeriodic && !isHealthCheck {
|
2018-03-19 12:06:09 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2018-03-20 21:56:49 +00:00
|
|
|
// Setup the required tickers
|
|
|
|
if isPeriodic {
|
|
|
|
ticker := time.NewTicker(fingerprintPeriod)
|
|
|
|
fingerprintTicker = ticker.C
|
|
|
|
defer ticker.Stop()
|
|
|
|
fm.logger.Printf("[DEBUG] client.fingerprint_manager: fingerprinting driver %s every %v", name, fingerprintPeriod)
|
|
|
|
}
|
2018-04-10 19:02:24 +00:00
|
|
|
|
|
|
|
var isHealthCheckPeriodic bool
|
2018-03-09 17:28:01 +00:00
|
|
|
if isHealthCheck {
|
2018-03-20 21:56:49 +00:00
|
|
|
// Determine the interval at which to health check
|
2018-03-09 17:28:01 +00:00
|
|
|
req := &cstructs.HealthCheckIntervalRequest{}
|
2018-04-10 19:02:24 +00:00
|
|
|
var healthCheckResp cstructs.HealthCheckIntervalResponse
|
2018-03-20 21:56:49 +00:00
|
|
|
|
2018-04-10 19:02:24 +00:00
|
|
|
if err := hc.GetHealthCheckInterval(req, &healthCheckResp); err != nil {
|
2018-03-20 21:56:49 +00:00
|
|
|
fm.logger.Printf("[ERR] client.fingerprint_manager: error getting health check interval for driver %s: %v", name, err)
|
2018-04-10 19:02:24 +00:00
|
|
|
} else if healthCheckResp.Eligible {
|
|
|
|
isHealthCheckPeriodic = true
|
|
|
|
ticker := time.NewTicker(healthCheckResp.Period)
|
2018-03-20 21:56:49 +00:00
|
|
|
healthTicker = ticker.C
|
|
|
|
defer ticker.Stop()
|
2018-04-10 19:02:24 +00:00
|
|
|
fm.logger.Printf("[DEBUG] client.fingerprint_manager: health checking driver %s every %v", name, healthCheckResp.Period)
|
2018-03-09 17:28:01 +00:00
|
|
|
}
|
2018-03-20 21:56:49 +00:00
|
|
|
}
|
2018-03-09 17:28:01 +00:00
|
|
|
|
2018-04-02 21:36:19 +00:00
|
|
|
driverEverDetected := false
|
2018-03-20 21:56:49 +00:00
|
|
|
for {
|
|
|
|
select {
|
|
|
|
case <-fm.shutdownCh:
|
|
|
|
return
|
|
|
|
case <-fingerprintTicker:
|
2018-04-10 19:02:24 +00:00
|
|
|
if _, err := fm.fingerprintDriver(name, d, isHealthCheckPeriodic); err != nil {
|
2018-03-20 21:56:49 +00:00
|
|
|
fm.logger.Printf("[DEBUG] client.fingerprint_manager: periodic fingerprinting for driver %v failed: %+v", name, err)
|
2018-03-09 17:28:01 +00:00
|
|
|
}
|
2018-04-02 21:36:19 +00:00
|
|
|
|
2018-03-20 21:56:49 +00:00
|
|
|
fm.nodeLock.Lock()
|
|
|
|
driver, detected := fm.node.Drivers[name]
|
2018-04-02 21:36:19 +00:00
|
|
|
|
|
|
|
// Memoize the driver detected status, so that we know whether to run the
|
|
|
|
// health check or not.
|
|
|
|
if detected && driver != nil && driver.Detected {
|
|
|
|
if !driverEverDetected {
|
|
|
|
driverEverDetected = true
|
|
|
|
}
|
2018-03-20 21:56:49 +00:00
|
|
|
}
|
|
|
|
fm.nodeLock.Unlock()
|
2018-04-02 21:36:19 +00:00
|
|
|
case <-healthTicker:
|
|
|
|
if driverEverDetected {
|
2018-03-20 21:56:49 +00:00
|
|
|
if err := fm.runDriverHealthCheck(name, hc); err != nil {
|
|
|
|
fm.logger.Printf("[DEBUG] client.fingerprint_manager: health checking for %v failed: %v", name, err)
|
2018-03-19 12:06:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-03-07 15:31:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-25 16:30:15 +00:00
|
|
|
// fingerprintDriver is a temporary solution to move towards DriverInfo and
|
|
|
|
// away from annotating a node's attributes to demonstrate support for a
|
|
|
|
// particular driver. Takes the FingerprintResponse and converts it to the
|
|
|
|
// proper DriverInfo update and then sets the prefix attributes as well
|
2018-04-10 19:02:24 +00:00
|
|
|
func (fm *FingerprintManager) fingerprintDriver(name string, f fingerprint.Fingerprint, hasPeriodicHealthCheck bool) (bool, error) {
|
2018-01-25 16:30:15 +00:00
|
|
|
var response cstructs.FingerprintResponse
|
2018-03-01 22:25:34 +00:00
|
|
|
|
|
|
|
fm.nodeLock.Lock()
|
2018-04-12 19:46:40 +00:00
|
|
|
|
|
|
|
// Determine if the driver has been detected before.
|
|
|
|
originalNode, haveDriver := fm.node.Drivers[name]
|
|
|
|
firstDetection := !haveDriver
|
|
|
|
|
|
|
|
// Determine if the driver is healthy
|
|
|
|
var driverIsHealthy bool
|
|
|
|
if haveDriver && originalNode.Healthy {
|
|
|
|
driverIsHealthy = true
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fingerprint the driver.
|
2018-03-03 01:21:13 +00:00
|
|
|
request := &cstructs.FingerprintRequest{Config: fm.getConfig(), Node: fm.node}
|
2018-03-01 22:25:34 +00:00
|
|
|
err := f.Fingerprint(request, &response)
|
|
|
|
fm.nodeLock.Unlock()
|
|
|
|
|
|
|
|
if err != nil {
|
2018-01-25 16:30:15 +00:00
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
|
2018-04-12 19:46:40 +00:00
|
|
|
fingerprintInfo := &structs.DriverInfo{
|
2018-03-22 22:09:36 +00:00
|
|
|
Attributes: response.Attributes,
|
2018-01-25 16:30:15 +00:00
|
|
|
Detected: response.Detected,
|
|
|
|
}
|
2018-03-22 22:09:36 +00:00
|
|
|
|
|
|
|
// Remove the attribute indicating the status of the driver, as the overall
|
|
|
|
// driver info object should indicate this.
|
2018-04-12 19:46:40 +00:00
|
|
|
delete(fingerprintInfo.Attributes, fmt.Sprintf("driver.%s", name))
|
|
|
|
|
|
|
|
// We set the health status based on the detection state of the driver if:
|
|
|
|
// * It is the first time we are fingerprinting the driver. This gives all
|
|
|
|
// drivers an initial health.
|
|
|
|
// * If the driver becomes undetected. This gives us an immediate unhealthy
|
|
|
|
// state and description when it transistions from detected and healthy to
|
|
|
|
// undetected.
|
|
|
|
// * If the driver does not have its own health checks. Then we always
|
|
|
|
// couple the states.
|
|
|
|
var healthInfo *structs.DriverInfo
|
|
|
|
if firstDetection || !hasPeriodicHealthCheck || !response.Detected && driverIsHealthy {
|
|
|
|
state := " "
|
|
|
|
if !response.Detected {
|
|
|
|
state = " not "
|
|
|
|
}
|
2018-04-10 17:38:53 +00:00
|
|
|
|
2018-04-12 19:46:40 +00:00
|
|
|
healthInfo = &structs.DriverInfo{
|
2018-04-10 19:02:24 +00:00
|
|
|
Healthy: response.Detected,
|
2018-04-12 19:46:40 +00:00
|
|
|
HealthDescription: fmt.Sprintf("Driver %s is%sdetected", name, state),
|
2018-04-05 21:59:13 +00:00
|
|
|
UpdateTime: time.Now(),
|
|
|
|
}
|
2018-04-12 19:46:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if node := fm.updateNodeFromDriver(name, fingerprintInfo, healthInfo); node != nil {
|
|
|
|
fm.setNode(node)
|
2018-04-05 21:59:13 +00:00
|
|
|
}
|
|
|
|
|
2018-01-25 16:30:15 +00:00
|
|
|
return response.Detected, nil
|
|
|
|
}
|
|
|
|
|
2018-03-19 16:50:18 +00:00
|
|
|
// runDriverHealthCheck checks the health of the specified resource.
|
|
|
|
func (fm *FingerprintManager) runDriverHealthCheck(name string, hc fingerprint.HealthCheck) error {
|
2018-01-25 16:30:15 +00:00
|
|
|
request := &cstructs.HealthCheckRequest{}
|
|
|
|
var response cstructs.HealthCheckResponse
|
2018-03-20 21:56:49 +00:00
|
|
|
if err := hc.HealthCheck(request, &response); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2018-01-25 16:30:15 +00:00
|
|
|
|
2018-03-20 17:25:07 +00:00
|
|
|
// Update the status of the node irregardless if there was an error- in the
|
|
|
|
// case of periodic health checks, an error will occur if a health check
|
|
|
|
// fails
|
2018-03-09 17:28:01 +00:00
|
|
|
if node := fm.updateNodeFromDriver(name, nil, response.Drivers[name]); node != nil {
|
2018-04-10 17:52:43 +00:00
|
|
|
fm.setNode(node)
|
2018-01-25 16:30:15 +00:00
|
|
|
}
|
|
|
|
|
2018-03-20 21:56:49 +00:00
|
|
|
return nil
|
2018-01-25 16:30:15 +00:00
|
|
|
}
|