mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
fix(baremetal): only do status probe job when host_type is hypervisor
This commit is contained in:
@@ -530,10 +530,13 @@ func newBaremetalInstance(man *SBaremetalManager, desc jsonutils.JSONObject) (*S
|
||||
serverLock: new(sync.Mutex),
|
||||
}
|
||||
bm.cronJobs = []IBaremetalCronJob{
|
||||
NewStatusProbeJob(bm, time.Duration(o.Options.StatusProbeIntervalSeconds)*time.Second),
|
||||
NewLogFetchJob(bm, time.Duration(o.Options.LogFetchIntervalSeconds)*time.Second),
|
||||
NewSendMetricsJob(bm, time.Duration(o.Options.SendMetricsIntervalSeconds)*time.Second),
|
||||
}
|
||||
hostType, _ := bm.desc.GetString("host_type")
|
||||
if !utils.IsInStringArray(hostType, []string{api.HOST_TYPE_KVM, api.HOST_TYPE_HYPERVISOR}) {
|
||||
bm.cronJobs = append(bm.cronJobs, NewStatusProbeJob(bm, time.Duration(o.Options.StatusProbeIntervalSeconds)*time.Second))
|
||||
}
|
||||
err := os.MkdirAll(bm.GetDir(), 0755)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user