Cloud API: support composes/<id>/manifests endpoint for non-koji builds
Support the composes/<id>/manifests API endpoint for non-koji builds. The endpoint will have to anyway handle `osbuild` job results once Koji composes will start using `osbuild` job type for builds. The endpoint previously contained a bug. If the `osbuild-koji` job had an empty manifest attached as a static job argument (this is the default type value), then this empty manifest was added to the endpoint response. Since Cloud API uses the depsolve and manifest jobs, the actual manifest was never attached to the job as a static argument. As a result, the endpoint was always returning an empty manifest for any koji compose. Fixing this required also adjusting unit tests, which was relying on the buggy behavior. Extend the unit test testing a successful compose to test the logs endpoint.
This commit is contained in:
parent
205dcd4147
commit
4032dea6d2
3 changed files with 91 additions and 23 deletions
|
|
@ -646,6 +646,19 @@ func TestComposeStatusSuccess(t *testing.T) {
|
|||
}
|
||||
]
|
||||
}`, jobId, jobId))
|
||||
|
||||
test.TestRoute(t, srv.Handler("/api/image-builder-composer/v2"), false, "GET", fmt.Sprintf("/api/image-builder-composer/v2/composes/%v/manifests", jobId), ``, http.StatusOK, fmt.Sprintf(`
|
||||
{
|
||||
"href": "/api/image-builder-composer/v2/composes/%v/manifests",
|
||||
"id": "%v",
|
||||
"kind": "ComposeManifests",
|
||||
"manifests": [
|
||||
{
|
||||
"pipeline": {},
|
||||
"sources": {}
|
||||
}
|
||||
]
|
||||
}`, jobId, jobId))
|
||||
}
|
||||
|
||||
func TestComposeStatusFailure(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue