MCPcopy Index your code
hub / github.com/cloudfoundry/cli / GetNewestReadyPackageForApplication

Method GetNewestReadyPackageForApplication

actor/v7action/package.go:132–150  ·  view source on GitHub ↗
(app resources.Application)

Source from the content-addressed store, hash-verified

130}
131
132func (actor Actor) GetNewestReadyPackageForApplication(app resources.Application) (resources.Package, Warnings, error) {
133 ccv3Packages, warnings, err := actor.CloudControllerClient.GetPackages(
134 ccv3.Query{Key: ccv3.AppGUIDFilter, Values: []string{app.GUID}},
135 ccv3.Query{Key: ccv3.StatesFilter, Values: []string{string(constant.PackageReady)}},
136 ccv3.Query{Key: ccv3.OrderBy, Values: []string{ccv3.CreatedAtDescendingOrder}},
137 ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}},
138 ccv3.Query{Key: ccv3.Page, Values: []string{"1"}},
139 )
140
141 if err != nil {
142 return resources.Package{}, Warnings(warnings), err
143 }
144
145 if len(ccv3Packages) == 0 {
146 return resources.Package{}, Warnings(warnings), actionerror.NoEligiblePackagesError{AppName: app.Name}
147 }
148
149 return resources.Package(ccv3Packages[0]), Warnings(warnings), nil
150}
151
152// GetApplicationPackages returns a list of package of an app.
153func (actor *Actor) GetApplicationPackages(appName string, spaceGUID string) ([]resources.Package, Warnings, error) {

Callers 1

CopyPackageMethod · 0.95

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 3

PackageStruct · 0.92
WarningsTypeAlias · 0.70
GetPackagesMethod · 0.65

Tested by

no test coverage detected