Skip to content

Commit

Permalink
Merge branch 'v7'
Browse files Browse the repository at this point in the history
  • Loading branch information
a-b committed Oct 27, 2020
2 parents 4fbc0b5 + d26da2b commit e767438
Show file tree
Hide file tree
Showing 4 changed files with 320 additions and 207 deletions.
13 changes: 10 additions & 3 deletions actor/cfnetworkingaction/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant"
"code.cloudfoundry.org/cli/resources"
"code.cloudfoundry.org/cli/util/batcher"
"code.cloudfoundry.org/cli/util/lookuptable"
)

Expand Down Expand Up @@ -227,9 +228,15 @@ func (actor Actor) getPoliciesForApplications(applications []resources.Applicati

destAppGUIDs := uniqueDestGUIDs(v1Policies)

destApplications, warnings, err := actor.CloudControllerClient.GetApplications(ccv3.Query{
Key: ccv3.GUIDFilter,
Values: destAppGUIDs,
var destApplications []resources.Application

warnings, err := batcher.RequestByGUID(destAppGUIDs, func(guids []string) (ccv3.Warnings, error) {
batch, warnings, err := actor.CloudControllerClient.GetApplications(ccv3.Query{
Key: ccv3.GUIDFilter,
Values: guids,
})
destApplications = append(destApplications, batch...)
return warnings, err
})
allWarnings = append(allWarnings, warnings...)
if err != nil {
Expand Down
Loading

0 comments on commit e767438

Please sign in to comment.