cloudapi: multiple upload targets in request
Add an array of targets in the imageRequest and return an array from ImageRequest.GetTargets() (renamed from GetTarget()). Currently, the function still only returns one target, the default for the image type with the top level upload options.
This commit is contained in:
parent
9d990ea5da
commit
d7ab1f2112
3 changed files with 17 additions and 15 deletions
|
|
@ -283,8 +283,9 @@ func getDefaultTarget(imageType ImageTypes) (UploadTypes, error) {
|
|||
}
|
||||
}
|
||||
|
||||
// GetTarget returns the target for the selected image type.
|
||||
func (ir *ImageRequest) GetTarget(request *ComposeRequest, imageType distro.ImageType) (irTarget *target.Target, err error) {
|
||||
// GetTargets returns all the targets for image request.
|
||||
func (ir *ImageRequest) GetTargets(request *ComposeRequest, imageType distro.ImageType) ([]*target.Target, error) {
|
||||
var irTarget *target.Target
|
||||
uploadTarget, err := getDefaultTarget(ir.ImageType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -316,7 +317,7 @@ func (ir *ImageRequest) GetTarget(request *ComposeRequest, imageType distro.Imag
|
|||
}
|
||||
irTarget.OsbuildArtifact.ExportName = imageType.Exports()[0]
|
||||
|
||||
return irTarget, nil
|
||||
return []*target.Target{irTarget}, nil
|
||||
}
|
||||
|
||||
// GetOSTreeOptions returns the image ostree options when included in the request
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue