diff --git a/cmd/osbuild-worker/jobimpl-ostree-resolve.go b/cmd/osbuild-worker/jobimpl-ostree-resolve.go index e5c831167..227c0f759 100644 --- a/cmd/osbuild-worker/jobimpl-ostree-resolve.go +++ b/cmd/osbuild-worker/jobimpl-ostree-resolve.go @@ -51,7 +51,7 @@ func (impl *OSTreeResolveJobImpl) Run(job worker.Job) error { logWithId.Infof("Resolving (%d) ostree commits", len(args.Specs)) for i, s := range args.Specs { - reqParams := ostree.RequestParams{ + reqParams := ostree.SourceSpec{ URL: s.URL, Ref: s.Ref, Parent: s.Parent, diff --git a/internal/cloudapi/v2/handler.go b/internal/cloudapi/v2/handler.go index d52d4cb7f..09fc0eafe 100644 --- a/internal/cloudapi/v2/handler.go +++ b/internal/cloudapi/v2/handler.go @@ -115,7 +115,7 @@ type imageRequest struct { repositories []rpmmd.RepoConfig imageOptions distro.ImageOptions target *target.Target - ostree *ostree.RequestParams + ostree *ostree.SourceSpec } func (h *apiHandlers) PostCompose(ctx echo.Context) error { @@ -458,10 +458,10 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error { } } - var ostreeOptions *ostree.RequestParams + var ostreeOptions *ostree.SourceSpec // assume it's an ostree image if the type has a default ostree ref if imageType.OSTreeRef() != "" { - ostreeOptions = &ostree.RequestParams{} + ostreeOptions = &ostree.SourceSpec{} if ir.Ostree != nil { if ir.Ostree.Ref != nil { ostreeOptions.Ref = *ir.Ostree.Ref diff --git a/internal/distro/distro_test_common/distro_test_common.go b/internal/distro/distro_test_common/distro_test_common.go index b31fd7a00..396080e39 100644 --- a/internal/distro/distro_test_common/distro_test_common.go +++ b/internal/distro/distro_test_common/distro_test_common.go @@ -40,12 +40,12 @@ func TestDistro_Manifest(t *testing.T, pipelinePath string, prefix string, regis PackageSets []string `json:"package-sets,omitempty"` } type composeRequest struct { - Distro string `json:"distro"` - Arch string `json:"arch"` - ImageType string `json:"image-type"` - Repositories []repository `json:"repositories"` - Blueprint *blueprint.Blueprint `json:"blueprint"` - OSTree *ostree.RequestParams `json:"ostree"` + Distro string `json:"distro"` + Arch string `json:"arch"` + ImageType string `json:"image-type"` + Repositories []repository `json:"repositories"` + Blueprint *blueprint.Blueprint `json:"blueprint"` + OSTree *ostree.SourceSpec `json:"ostree"` } var tt struct { ComposeRequest *composeRequest `json:"compose-request"` diff --git a/internal/ostree/ostree.go b/internal/ostree/ostree.go index 337264ae0..4fe37b7ac 100644 --- a/internal/ostree/ostree.go +++ b/internal/ostree/ostree.go @@ -19,9 +19,9 @@ import ( var ostreeRefRE = regexp.MustCompile(`^(?:[\w\d][-._\w\d]*\/)*[\w\d][-._\w\d]*$`) -// RequestParams serves as input for ResolveParams, and contains all necessary variables to resolve +// SourceSpec serves as input for ResolveParams, and contains all necessary variables to resolve // a ref, which can then be turned into a CommitSpec. -type RequestParams struct { +type SourceSpec struct { URL string `json:"url"` Ref string `json:"ref"` Parent string `json:"parent"` @@ -145,7 +145,7 @@ func ResolveRef(location, ref string, consumerCerts bool, subs *rhsm.Subscriptio // If Parent is not specified in the RequestParams, the value of Ref is used. // // If any ref (Ref or Parent) is malformed, the function returns with a RefError. -func ResolveParams(params RequestParams) (ref, checksum string, err error) { +func ResolveParams(params SourceSpec) (ref, checksum string, err error) { ref = params.Ref // Determine value of ref diff --git a/internal/weldr/api.go b/internal/weldr/api.go index 557f1e965..ad890d02a 100644 --- a/internal/weldr/api.go +++ b/internal/weldr/api.go @@ -2352,12 +2352,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.RequestParams `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.SourceSpec `json:"ostree"` + Branch string `json:"branch"` + Upload *uploadRequest `json:"upload"` } type ComposeReply struct { BuildID uuid.UUID `json:"build_id"`