Move where attribute for driver detection is set

This commit is contained in:
Alex Dadgar
2018-04-12 15:50:25 -07:00
parent 228a2319c2
commit e0171acbdd
2 changed files with 10 additions and 4 deletions

View File

@@ -1053,6 +1053,16 @@ func (c *Client) updateNodeFromDriver(name string, fingerprint, health *structs.
}
}
}
// COMPAT Remove in Nomad 0.10
// We maintain the driver enabled attribute until all drivers expose
// their attributes as DriverInfo
driverName := fmt.Sprintf("driver.%s", name)
if fingerprint.Detected {
c.config.Node.Attributes[driverName] = "1"
} else {
delete(c.config.Node.Attributes, driverName)
}
}
if health != nil {

View File

@@ -345,10 +345,6 @@ func (fm *FingerprintManager) fingerprintDriver(name string, f fingerprint.Finge
return false, err
}
if node := fm.updateNodeAttributes(&response); node != nil {
fm.setNode(node)
}
// Remove the health check attribute indicating the status of the driver,
// as the overall driver info object should indicate this.
delete(response.Attributes, fmt.Sprintf("driver.%s", name))