Skip to content

Commit

Permalink
fix host details output
Browse files Browse the repository at this point in the history
  • Loading branch information
wanyaoqi committed Apr 30, 2020
1 parent 8e55ffa commit db2d02f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/apis/compute/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ type HostDetails struct {
IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
CanPrepare bool `json:"can_prepare"`
PrepareFailReason string `json:"prepare_fail_reason"`
// 允许开启宿主机健康检查
EnableHealthCheck bool `json:"enable_health_check"`

// 标签
Metadata map[string]string `json:"metadata"`
Expand Down
3 changes: 3 additions & 0 deletions pkg/compute/models/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2606,6 +2606,9 @@ func (self *SHost) getMoreDetails(ctx context.Context, out api.HostDetails, show
}
}

if self.EnableHealthCheck && hostHealthChecker != nil {
out.EnableHealthCheck = true
}
return out
}

Expand Down

0 comments on commit db2d02f

Please sign in to comment.