Merge pull request #6151 from wanyaoqi/bugfix/wyq/minor-fix-0430

fix host details output
This commit is contained in:
Zexi Li
2020-04-30 19:08:15 +08:00
committed by GitHub
3 changed files with 8 additions and 0 deletions
+2
View File
@@ -163,6 +163,8 @@ type HostDetails struct {
IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
CanPrepare bool `json:"can_prepare"`
PrepareFailReason string `json:"prepare_fail_reason"`
// 允许开启宿主机健康检查
AllowHealthCheck bool `json:"allow_health_check"`
// 标签
Metadata map[string]string `json:"metadata"`
+3
View File
@@ -2606,6 +2606,9 @@ func (self *SHost) getMoreDetails(ctx context.Context, out api.HostDetails, show
}
}
if self.EnableHealthCheck && hostHealthChecker != nil {
out.AllowHealthCheck = true
}
return out
}
+3
View File
@@ -141,6 +141,9 @@ func (host *SHostService) initEtcdConfig() error {
if err != nil {
return errors.Wrap(err, "fetch etcd service info")
}
if etcdEndpoint == nil {
return nil
}
if len(options.HostOptions.EtcdEndpoints) == 0 {
options.HostOptions.EtcdEndpoints = []string{etcdEndpoint.Url}
if len(etcdEndpoint.CertId) > 0 {