Merge pull request #10602 from rainzm/automated-cherry-pick-of-#10601-upstream-release-3.7

Automated cherry pick of #10601: Fix the problem of hostwire producted by #9723
This commit is contained in:
Zexi Li
2021-04-02 20:04:43 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ func init() {
type SHostwire struct {
SHostJointsBase
Bridge string `width:"16" charset:"ascii" nullable:"false" list:"domain" update:"domain" create:"domain_required"`
Bridge string `width:"64" charset:"ascii" nullable:"false" list:"domain" update:"domain" create:"domain_required"`
// 接口名称
Interface string `width:"16" charset:"ascii" nullable:"false" list:"domain" update:"domain" create:"domain_required"`
// 是否是主地址
+1 -1
View File
@@ -237,7 +237,7 @@ func (wire *SWire) getHostwireQuery() *sqlchemy.SQuery {
}
func (wire *SWire) HostCount() (int, error) {
q := wire.getHostwireQuery()
q := HostwireManager.Query().Equals("wire_id", wire.Id).GroupBy("host_id")
return q.CountWithError()
}