Weldr/ComposeRequest: OSTree options nil if not set
Previously, the `OSTree` property in the Weldr API `ComposeRequest` struct was not a pointer to the `ostree.ImageOptions` type. As a result, it was initialized to an empty struct, even if not set in the client API call. As a result, the `OSTree` property in the `distro.ImageOptions` was always not `nil`, when initializing the osbuild manifest. However, after a change in `osbuild/images` [0], providing OSTree options for non-OSTree image types is no longer considered valid. This caused a failure to submit a new compose for any non-OSTree image type. Change the `OSTree` property in Weldr `ComposeRequest` to be a pointer and mark it as optional. [0] https://github.com/osbuild/images/pull/1071 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
fdff0a903e
commit
1f590aa232
1 changed files with 7 additions and 7 deletions
|
|
@ -2415,12 +2415,12 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request
|
|||
|
||||
// https://weldr.io/lorax/pylorax.api.html#pylorax.api.v0.v0_compose_start
|
||||
type ComposeRequest struct {
|
||||
BlueprintName string `json:"blueprint_name"`
|
||||
ComposeType string `json:"compose_type"`
|
||||
Size uint64 `json:"size"`
|
||||
OSTree ostree.ImageOptions `json:"ostree"`
|
||||
Branch string `json:"branch"`
|
||||
Upload *uploadRequest `json:"upload"`
|
||||
BlueprintName string `json:"blueprint_name"`
|
||||
ComposeType string `json:"compose_type"`
|
||||
Size uint64 `json:"size"`
|
||||
OSTree *ostree.ImageOptions `json:"ostree,omitempty"`
|
||||
Branch string `json:"branch"`
|
||||
Upload *uploadRequest `json:"upload"`
|
||||
}
|
||||
type ComposeReply struct {
|
||||
BuildID uuid.UUID `json:"build_id"`
|
||||
|
|
@ -2549,7 +2549,7 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request
|
|||
|
||||
options := distro.ImageOptions{
|
||||
Size: size,
|
||||
OSTree: &cr.OSTree,
|
||||
OSTree: cr.OSTree,
|
||||
PartitioningMode: pm,
|
||||
}
|
||||
options.Facts = &facts.ImageOptions{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue