add detected to more drivers where the driver is found but unusable

This commit is contained in:
Chelsea Holland Komlo
2018-02-01 11:28:17 -05:00
parent ba2ebbc7f9
commit e5ccc551dc
2 changed files with 4 additions and 1 deletions

View File

@@ -13,6 +13,9 @@ const (
)
func (d *ExecDriver) Fingerprint(req *cstructs.FingerprintRequest, resp *cstructs.FingerprintResponse) error {
// The exec driver will be detected in every case
resp.Detected = true
// Only enable if cgroups are available and we are root
if !cgroupsMounted(req.Node) {
if d.fingerprintSuccess == nil || *d.fingerprintSuccess {
@@ -35,6 +38,5 @@ func (d *ExecDriver) Fingerprint(req *cstructs.FingerprintRequest, resp *cstruct
}
resp.AddAttribute(execDriverAttr, "1")
d.fingerprintSuccess = helper.BoolToPtr(true)
resp.Detected = true
return nil
}

View File

@@ -119,6 +119,7 @@ func (d *JavaDriver) Fingerprint(req *cstructs.FingerprintRequest, resp *cstruct
}
d.fingerprintSuccess = helper.BoolToPtr(false)
resp.RemoveAttribute(javaDriverAttr)
resp.Detected = true
return nil
}