osbuild: move result serialization from common
In the same way `osbuild.Manifest` is the input to the osbuild API, `osbuild.Result` is the output. Move it to the `osbuild` package where it belongs. This is not a functional change. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
360bf2aa04
commit
ac5f69e757
7 changed files with 23 additions and 18 deletions
|
|
@ -15,6 +15,7 @@ import (
|
|||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
"github.com/osbuild/osbuild-composer/internal/target"
|
||||
)
|
||||
|
||||
|
|
@ -111,7 +112,7 @@ func (c *Client) JobCanceled(job *Job) bool {
|
|||
return jr.Canceled
|
||||
}
|
||||
|
||||
func (c *Client) UpdateJob(job *Job, status common.ImageBuildState, result *common.ComposeResult) error {
|
||||
func (c *Client) UpdateJob(job *Job, status common.ImageBuildState, result *osbuild.Result) error {
|
||||
var b bytes.Buffer
|
||||
err := json.NewEncoder(&b).Encode(&updateJobRequest{status, result})
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
|
||||
"github.com/osbuild/osbuild-composer/internal/common"
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
"github.com/osbuild/osbuild-composer/internal/target"
|
||||
)
|
||||
|
||||
|
|
@ -18,7 +19,7 @@ type OSBuildJob struct {
|
|||
}
|
||||
|
||||
type OSBuildJobResult struct {
|
||||
OSBuildOutput *common.ComposeResult `json:"osbuild_output,omitempty"`
|
||||
OSBuildOutput *osbuild.Result `json:"osbuild_output,omitempty"`
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -49,7 +50,7 @@ type jobResponse struct {
|
|||
|
||||
type updateJobRequest struct {
|
||||
Status common.ImageBuildState `json:"status"`
|
||||
Result *common.ComposeResult `json:"result"`
|
||||
Result *osbuild.Result `json:"result"`
|
||||
}
|
||||
|
||||
type updateJobResponse struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue