Skip to content

Commit

Permalink
fix/autoscaling: Add 'scaling_group_id' for server-list result
Browse files Browse the repository at this point in the history
  • Loading branch information
rainzm committed Apr 24, 2020
1 parent 32280e2 commit 16226be
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/compute/models/guest_queries.go
Expand Up @@ -170,21 +170,12 @@ func (manager *SGuestManager) FetchCustomizeColumns(
}
}
}
if len(fields) == 0 || fields.Contains("scaling_status") {
if len(fields) == 0 || fields.Contains("scaling_group") {
sggs := fetchScalingGroupGuest(guestIds...)
if sggs != nil && len(sggs) != 0 {
for i := range rows {
if sgg, ok := sggs[guestIds[i]]; ok {
rows[i].ScalingStatus = sgg.GuestStatus
}
}
}
}
if fields.Contains("scaling_group_id") {
sggs := fetchScalingGroupGuest(guestIds...)
if sggs != nil && len(sggs) != 0 {
for i := range rows {
if sgg, ok := sggs[guestIds[i]]; ok {
rows[i].ScalingGroupId = sgg.ScalingGroupId
}
}
Expand Down

0 comments on commit 16226be

Please sign in to comment.