Skip to content

Commit

Permalink
Don't fetch unneeded pages
Browse files Browse the repository at this point in the history
- introduce 'Page' query key
- when set, stop automatic pagination
- add 'PerPage' and 'Page' query keys to all list endpoints where only a
  single item from the returned list is used
- use 'MakeListRequest' function in 'GetEvents' and set 'Page' query key
  in caller
- adapt 'StagePackage' function to include 'GUIDFilter' instead of
  iterating over the returned package list and comparing guids
  • Loading branch information
philippthun authored and a-b committed Jan 17, 2024
1 parent 2aecb3c commit 3f361ac
Show file tree
Hide file tree
Showing 57 changed files with 485 additions and 288 deletions.
4 changes: 3 additions & 1 deletion actor/v7action/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ func (actor Actor) GetUnstagedNewestPackageGUID(appGUID string) (string, Warning
packages, warnings, err := actor.CloudControllerClient.GetPackages(
ccv3.Query{Key: ccv3.AppGUIDFilter, Values: []string{appGUID}},
ccv3.Query{Key: ccv3.OrderBy, Values: []string{ccv3.CreatedAtDescendingOrder}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}})
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}})
allWarnings = append(allWarnings, warnings...)
if err != nil {
return "", allWarnings, err
Expand All @@ -241,6 +242,7 @@ func (actor Actor) GetUnstagedNewestPackageGUID(appGUID string) (string, Warning
newestPackage.GUID,
ccv3.Query{Key: ccv3.StatesFilter, Values: []string{"STAGED"}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
)
allWarnings = append(allWarnings, warnings...)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion actor/v7action/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,7 @@ var _ = Describe("Application Actions", func() {
ccv3.Query{Key: ccv3.AppGUIDFilter, Values: []string{"some-app-guid"}},
ccv3.Query{Key: ccv3.OrderBy, Values: []string{ccv3.CreatedAtDescendingOrder}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down Expand Up @@ -1998,8 +1999,9 @@ var _ = Describe("Application Actions", func() {
packageGuid, queries := fakeCloudControllerClient.GetPackageDropletsArgsForCall(0)
Expect(packageGuid).To(Equal("package-guid"))
Expect(queries).To(ConsistOf(
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.StatesFilter, Values: []string{"STAGED"}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down
20 changes: 7 additions & 13 deletions actor/v7action/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,19 @@ func (actor Actor) StagePackage(packageGUID, appName, spaceGUID string) (<-chan
}
app := apps[0]

pkgs, allWarnings, err := actor.CloudControllerClient.GetPackages(ccv3.Query{
Key: ccv3.AppGUIDFilter, Values: []string{app.GUID},
})
pkgs, allWarnings, err := actor.CloudControllerClient.GetPackages(
ccv3.Query{Key: ccv3.GUIDFilter, Values: []string{packageGUID}},
ccv3.Query{Key: ccv3.AppGUIDFilter, Values: []string{app.GUID}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
)
warningsStream <- Warnings(allWarnings)
if err != nil {
errorStream <- err
return
}

if !packageInPackages(packageGUID, pkgs) {
if len(pkgs) == 0 {
err = actionerror.PackageNotFoundInAppError{GUID: packageGUID, AppName: appName}
errorStream <- err
return
Expand Down Expand Up @@ -166,12 +169,3 @@ func (actor Actor) PollBuild(buildGUID string, appName string) (resources.Drople
}
}
}

func packageInPackages(targetPkgGUID string, pkgs []resources.Package) bool {
for i := range pkgs {
if pkgs[i].GUID == targetPkgGUID {
return true
}
}
return false
}
5 changes: 4 additions & 1 deletion actor/v7action/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var _ = Describe("Build Actions", func() {
BeforeEach(func() {
fakeCloudControllerClient.GetApplicationsReturns([]resources.Application{{GUID: appGUID}}, ccv3.Warnings{"get-apps-warning"}, nil)
fakeCloudControllerClient.GetPackagesReturns(
[]resources.Package{{GUID: "some-other-package-guid"}},
[]resources.Package{},
ccv3.Warnings{"get-packages-warning"},
nil,
)
Expand Down Expand Up @@ -180,7 +180,10 @@ var _ = Describe("Build Actions", func() {

Expect(fakeCloudControllerClient.GetPackagesCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetPackagesArgsForCall(0)).To(Equal([]ccv3.Query{
{Key: ccv3.GUIDFilter, Values: []string{packageGUID}},
{Key: ccv3.AppGUIDFilter, Values: []string{appGUID}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
}))

Expect(fakeCloudControllerClient.CreateBuildCallCount()).To(Equal(1))
Expand Down
1 change: 1 addition & 0 deletions actor/v7action/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func (actor Actor) GetLatestActiveDeploymentForApp(appGUID string) (resources.De
ccv3.Query{Key: ccv3.StatusValueFilter, Values: []string{string(constant.DeploymentStatusValueActive)}},
ccv3.Query{Key: ccv3.OrderBy, Values: []string{ccv3.CreatedAtDescendingOrder}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
)

if err != nil {
Expand Down
1 change: 1 addition & 0 deletions actor/v7action/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ var _ = Describe("Deployment Actions", func() {
{Key: ccv3.StatusValueFilter, Values: []string{string(constant.DeploymentStatusValueActive)}},
{Key: ccv3.OrderBy, Values: []string{ccv3.CreatedAtDescendingOrder}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
},
))
})
Expand Down
2 changes: 2 additions & 0 deletions actor/v7action/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ func (actor Actor) GetDomainAndOrgGUIDsByName(domainName string, orgName string)
func (actor Actor) getDomainByName(domainName string) (resources.Domain, ccv3.Warnings, error) {
domains, warnings, err := actor.CloudControllerClient.GetDomains(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{domainName}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
)
switch {
case err != nil:
Expand Down
44 changes: 37 additions & 7 deletions actor/v7action/domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ var _ = Describe("Domain Actions", func() {
givenQuery := fakeCloudControllerClient.GetDomainsArgsForCall(0)
Expect(givenQuery).To(Equal([]ccv3.Query{
{Key: ccv3.NameFilter, Values: []string{domainName}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
}))

Expect(fakeCloudControllerClient.CheckRouteCallCount()).To(Equal(1))
Expand Down Expand Up @@ -438,7 +440,11 @@ var _ = Describe("Domain Actions", func() {
})

When("the API layer call is successful", func() {
expectedQuery := []ccv3.Query{{Key: ccv3.NameFilter, Values: []string{domain1Name}}}
expectedQuery := []ccv3.Query{
{Key: ccv3.NameFilter, Values: []string{domain1Name}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
}
BeforeEach(func() {
fakeCloudControllerClient.GetDomainsReturns(
ccv3Domains,
Expand Down Expand Up @@ -512,7 +518,11 @@ var _ = Describe("Domain Actions", func() {

Expect(fakeCloudControllerClient.GetDomainsCallCount()).To(Equal(1))
actualQuery := fakeCloudControllerClient.GetDomainsArgsForCall(0)
Expect(actualQuery).To(Equal([]ccv3.Query{{Key: ccv3.NameFilter, Values: []string{"private-domain.com"}}}))
Expect(actualQuery).To(Equal([]ccv3.Query{
{Key: ccv3.NameFilter, Values: []string{"private-domain.com"}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
}))

Expect(fakeCloudControllerClient.SharePrivateDomainToOrgsCallCount()).To(Equal(1))
domainGuid, sharedOrgs := fakeCloudControllerClient.SharePrivateDomainToOrgsArgsForCall(0)
Expand Down Expand Up @@ -634,7 +644,11 @@ var _ = Describe("Domain Actions", func() {
It("returns the error and doesnt get the domain", func() {
Expect(fakeCloudControllerClient.GetOrganizationsCallCount()).To(Equal(1))
actualQuery := fakeCloudControllerClient.GetOrganizationsArgsForCall(0)
Expect(actualQuery).To(Equal([]ccv3.Query{{Key: ccv3.NameFilter, Values: []string{orgName}}}))
Expect(actualQuery).To(Equal([]ccv3.Query{
{Key: ccv3.NameFilter, Values: []string{orgName}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
}))

Expect(fakeCloudControllerClient.GetDomainsCallCount()).To(Equal(0))

Expand Down Expand Up @@ -665,11 +679,19 @@ var _ = Describe("Domain Actions", func() {
It("returns the error and doesnt get the domain", func() {
Expect(fakeCloudControllerClient.GetOrganizationsCallCount()).To(Equal(1))
actualQuery := fakeCloudControllerClient.GetOrganizationsArgsForCall(0)
Expect(actualQuery).To(Equal([]ccv3.Query{{Key: ccv3.NameFilter, Values: []string{orgName}}}))
Expect(actualQuery).To(Equal([]ccv3.Query{
{Key: ccv3.NameFilter, Values: []string{orgName}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
}))

Expect(fakeCloudControllerClient.GetDomainsCallCount()).To(Equal(1))
actualQuery = fakeCloudControllerClient.GetDomainsArgsForCall(0)
Expect(actualQuery).To(Equal([]ccv3.Query{{Key: ccv3.NameFilter, Values: []string{domainName}}}))
Expect(actualQuery).To(Equal([]ccv3.Query{
{Key: ccv3.NameFilter, Values: []string{domainName}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
}))

Expect(executeErr).To(MatchError(errors.New("get-domains-error")))
Expect(warnings).To(ConsistOf("get-orgs-warning", "get-domains-warning"))
Expand All @@ -690,11 +712,19 @@ var _ = Describe("Domain Actions", func() {
It("returns the GUIDs", func() {
Expect(fakeCloudControllerClient.GetOrganizationsCallCount()).To(Equal(1))
actualQuery := fakeCloudControllerClient.GetOrganizationsArgsForCall(0)
Expect(actualQuery).To(Equal([]ccv3.Query{{Key: ccv3.NameFilter, Values: []string{orgName}}}))
Expect(actualQuery).To(Equal([]ccv3.Query{
{Key: ccv3.NameFilter, Values: []string{orgName}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
}))

Expect(fakeCloudControllerClient.GetDomainsCallCount()).To(Equal(1))
actualQuery = fakeCloudControllerClient.GetDomainsArgsForCall(0)
Expect(actualQuery).To(Equal([]ccv3.Query{{Key: ccv3.NameFilter, Values: []string{domainName}}}))
Expect(actualQuery).To(Equal([]ccv3.Query{
{Key: ccv3.NameFilter, Values: []string{domainName}},
{Key: ccv3.PerPage, Values: []string{"1"}},
{Key: ccv3.Page, Values: []string{"1"}},
}))

Expect(executeErr).ToNot(HaveOccurred())
Expect(warnings).To(ConsistOf("get-orgs-warning", "get-domains-warning"))
Expand Down
2 changes: 2 additions & 0 deletions actor/v7action/droplet.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ func (actor Actor) DownloadDropletByGUIDAndAppName(dropletGUID string, appName s
droplets, getDropletWarnings, err := actor.CloudControllerClient.GetDroplets(
ccv3.Query{Key: ccv3.GUIDFilter, Values: []string{dropletGUID}},
ccv3.Query{Key: ccv3.AppGUIDFilter, Values: []string{app.GUID}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
)
allWarnings = append(allWarnings, getDropletWarnings...)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions actor/v7action/droplet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,8 @@ var _ = Describe("Droplet Actions", func() {
Expect(fakeCloudControllerClient.GetDropletsArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.GUIDFilter, Values: []string{"some-droplet-guid"}},
ccv3.Query{Key: ccv3.AppGUIDFilter, Values: []string{"some-app-guid"}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))

Expect(fakeCloudControllerClient.DownloadDropletCallCount()).To(Equal(1))
Expand Down
1 change: 1 addition & 0 deletions actor/v7action/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func (actor Actor) GetRecentEventsByApplicationNameAndSpace(appName string, spac
ccEvents, warnings, err := actor.CloudControllerClient.GetEvents(
ccv3.Query{Key: ccv3.TargetGUIDFilter, Values: []string{app.GUID}},
ccv3.Query{Key: ccv3.OrderBy, Values: []string{ccv3.CreatedAtDescendingOrder}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
)
allWarnings = append(allWarnings, warnings...)

Expand Down
2 changes: 2 additions & 0 deletions actor/v7action/isolation_segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ func (actor Actor) AssignIsolationSegmentToSpaceByNameAndSpace(isolationSegmentN
func (actor Actor) GetIsolationSegmentByName(name string) (resources.IsolationSegment, Warnings, error) {
isolationSegments, warnings, err := actor.CloudControllerClient.GetIsolationSegments(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{name}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
)
if err != nil {
return resources.IsolationSegment{}, Warnings(warnings), err
Expand Down
6 changes: 6 additions & 0 deletions actor/v7action/isolation_segment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ var _ = Describe("Isolation Segment Actions", func() {
Expect(fakeCloudControllerClient.GetIsolationSegmentsCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetIsolationSegmentsArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{"some-iso-seg"}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))

Expect(fakeCloudControllerClient.DeleteIsolationSegmentCallCount()).To(Equal(1))
Expand Down Expand Up @@ -266,6 +268,8 @@ var _ = Describe("Isolation Segment Actions", func() {
Expect(fakeCloudControllerClient.GetIsolationSegmentsCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetIsolationSegmentsArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{"some-iso-seg"}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))

Expect(fakeCloudControllerClient.UpdateSpaceIsolationSegmentRelationshipCallCount()).To(Equal(1))
Expand Down Expand Up @@ -438,6 +442,8 @@ var _ = Describe("Isolation Segment Actions", func() {
Expect(fakeCloudControllerClient.GetIsolationSegmentsCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetIsolationSegmentsArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{"some-iso-seg"}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})
})
Expand Down
18 changes: 18 additions & 0 deletions actor/v7action/label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ var _ = Describe("labels", func() {
Expect(fakeCloudControllerClient.GetDomainsCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetDomainsArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{resourceName}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down Expand Up @@ -221,6 +223,8 @@ var _ = Describe("labels", func() {
Expect(fakeCloudControllerClient.GetOrganizationsCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetOrganizationsArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{resourceName}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down Expand Up @@ -311,6 +315,8 @@ var _ = Describe("labels", func() {
Expect(fakeCloudControllerClient.GetDomainsCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetDomainsArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{"sub.example.com"}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand All @@ -321,6 +327,8 @@ var _ = Describe("labels", func() {
ccv3.Query{Key: ccv3.DomainGUIDFilter, Values: []string{"domain-guid"}},
ccv3.Query{Key: ccv3.HostsFilter, Values: []string{""}},
ccv3.Query{Key: ccv3.PathsFilter, Values: []string{"/my-route/path"}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down Expand Up @@ -413,6 +421,8 @@ var _ = Describe("labels", func() {
Expect(fakeCloudControllerClient.GetSpacesArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{resourceName}},
ccv3.Query{Key: ccv3.OrganizationGUIDFilter, Values: []string{orgGUID}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down Expand Up @@ -494,6 +504,8 @@ var _ = Describe("labels", func() {
Expect(fakeCloudControllerClient.GetStacksCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetStacksArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{resourceName}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down Expand Up @@ -938,6 +950,8 @@ var _ = Describe("labels", func() {
Expect(fakeCloudControllerClient.GetDomainsCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetDomainsArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{resourceName}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down Expand Up @@ -1022,6 +1036,8 @@ var _ = Describe("labels", func() {
ccv3.Query{Key: ccv3.DomainGUIDFilter, Values: []string{"domain-guid"}},
ccv3.Query{Key: ccv3.HostsFilter, Values: []string{""}},
ccv3.Query{Key: ccv3.PathsFilter, Values: []string{"/my-route/path"}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down Expand Up @@ -1102,6 +1118,8 @@ var _ = Describe("labels", func() {
Expect(fakeCloudControllerClient.GetStacksCallCount()).To(Equal(1))
Expect(fakeCloudControllerClient.GetStacksArgsForCall(0)).To(ConsistOf(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{resourceName}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
))
})

Expand Down
2 changes: 2 additions & 0 deletions actor/v7action/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func (actor Actor) GetOrganizationByGUID(orgGUID string) (resources.Organization
func (actor Actor) GetOrganizationByName(name string) (resources.Organization, Warnings, error) {
orgs, warnings, err := actor.CloudControllerClient.GetOrganizations(
ccv3.Query{Key: ccv3.NameFilter, Values: []string{name}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
)
if err != nil {
return resources.Organization{}, Warnings(warnings), err
Expand Down
7 changes: 3 additions & 4 deletions actor/v7action/organization_quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ func (actor Actor) GetOrganizationQuotas() ([]resources.OrganizationQuota, Warni

func (actor Actor) GetOrganizationQuotaByName(orgQuotaName string) (resources.OrganizationQuota, Warnings, error) {
ccv3OrgQuotas, warnings, err := actor.CloudControllerClient.GetOrganizationQuotas(
ccv3.Query{
Key: ccv3.NameFilter,
Values: []string{orgQuotaName},
},
ccv3.Query{Key: ccv3.NameFilter, Values: []string{orgQuotaName}},
ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
)
if err != nil {
return resources.OrganizationQuota{}, Warnings(warnings), err
Expand Down
Loading

0 comments on commit 3f361ac

Please sign in to comment.