(sourceApp resources.Application, targetApp resources.Application)
| 230 | } |
| 231 | |
| 232 | func (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 | } |
nothing calls this directly
no test coverage detected