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

Method CopyPackage

actor/v7action/package.go:232–252  ·  view source on GitHub ↗
(sourceApp resources.Application, targetApp resources.Application)

Source from the content-addressed store, hash-verified

230}
231
232func (actor Actor) CopyPackage(sourceApp resources.Application, targetApp resources.Application) (resources.Package, Warnings, error) {
233 var allWarnings Warnings
234 sourcePkg, warnings, err := actor.GetNewestReadyPackageForApplication(sourceApp)
235 allWarnings = append(allWarnings, warnings...)
236 if err != nil {
237 return resources.Package{}, allWarnings, err
238 }
239 targetPkg, ccv3Warnings, err := actor.CloudControllerClient.CopyPackage(sourcePkg.GUID, targetApp.GUID)
240 allWarnings = append(allWarnings, ccv3Warnings...)
241 if err != nil {
242 return resources.Package{}, allWarnings, err
243 }
244
245 readyPackage, warnings, err := actor.PollPackage(resources.Package(targetPkg))
246 allWarnings = append(allWarnings, warnings...)
247 if err != nil {
248 return resources.Package{}, allWarnings, err
249 }
250
251 return readyPackage, allWarnings, nil
252}

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 4

PollPackageMethod · 0.95
PackageStruct · 0.92
CopyPackageMethod · 0.65

Tested by

no test coverage detected