This moves some of the code from the PostCompose function in handler.go into methods on the OpenAPI ComposeRequest and ImageRequest structs. In compose.go I have added several methods. GetBlueprintWithCustomizations takes the ComposeRequest customizations and builds a Blueprint struct. GetPayloadRepositories returns the custom payload repos. GetSubscription returns the ImageOptions setup with optional subscription information from the request. In imagerequest.go I have added GetTarget which takes the upload options and returns a Target. This moves the giant switch statement, which may also benefit from further simplification at some point. GetOSTreeOptions returns the OSTree ImageOptions if there are ostree settings in the ImageRequest. GetImageOptions returns the distro.ImageOptions with the size set. This commit only moves the code, making PostCompose easier to read. All tests still pass. cloudapi: Move the size handling to a method on ImageRequest |
||
|---|---|---|
| .. | ||
| v2 | ||
| server.go | ||