mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
vpcagent: models: annotate guest with guestnetworks
This commit is contained in:
@@ -107,6 +107,7 @@ type Guest struct {
|
||||
Host *Host `json:"-"`
|
||||
AdminSecurityGroup *SecurityGroup `json:"-"`
|
||||
SecurityGroups SecurityGroups `json:"-"`
|
||||
Guestnetworks Guestnetworks `json:"-"`
|
||||
}
|
||||
|
||||
func (el *Guest) Copy() *Guest {
|
||||
|
||||
@@ -401,6 +401,11 @@ func (set Guestnetworks) joinGuests(subEntries Guests) bool {
|
||||
continue
|
||||
}
|
||||
gn.Guest = g
|
||||
if g.Guestnetworks == nil {
|
||||
g.Guestnetworks = Guestnetworks{}
|
||||
}
|
||||
rowIdStr := fmt.Sprintf("%d", gn.RowId)
|
||||
g.Guestnetworks[rowIdStr] = gn
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user