worker: deprecate the local target
Add "image_name" and "stream_optimized" fields to the osbuild job as replacement for the local target options. The former signifies the name of the uploaded artifact and whether an artifact should be uploaded at all (only weldr API). The latter will be deprecated at some point, when osbuild itself can make streamoptimized vmdk images. This change separates what have always been two distinct concepts: artifacts that are reported back to the composer node (in practice always running on the same machine), and upload targets to clouds and such. Separating them makes it easier to add job types that only allow one upload target while keeping artifacts. Keep the local target around, so that jobs that are scheduled can still be run after an upgrade.
This commit is contained in:
parent
d1f322ec6f
commit
0cd7174598
9 changed files with 66 additions and 65 deletions
|
|
@ -178,20 +178,25 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
|
|||
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Could not initialize build with koji: %v", err))
|
||||
}
|
||||
|
||||
id, err := h.server.workers.Enqueue(ir.arch, ir.manifest, []*target.Target{
|
||||
target.NewKojiTarget(&target.KojiTargetOptions{
|
||||
BuildID: uint64(buildInfo.BuildID),
|
||||
TaskID: uint64(request.Koji.TaskId),
|
||||
Token: buildInfo.Token,
|
||||
Name: request.Name,
|
||||
Version: request.Version,
|
||||
Release: request.Release,
|
||||
Filename: ir.filename,
|
||||
UploadDirectory: "osbuild-composer-koji-" + uuid.New().String(),
|
||||
Server: request.Koji.Server,
|
||||
KojiFilename: ir.kojiFilename,
|
||||
}),
|
||||
})
|
||||
job := worker.OSBuildJob{
|
||||
Manifest: ir.manifest,
|
||||
Targets: []*target.Target{
|
||||
target.NewKojiTarget(&target.KojiTargetOptions{
|
||||
BuildID: uint64(buildInfo.BuildID),
|
||||
TaskID: uint64(request.Koji.TaskId),
|
||||
Token: buildInfo.Token,
|
||||
Name: request.Name,
|
||||
Version: request.Version,
|
||||
Release: request.Release,
|
||||
Filename: ir.filename,
|
||||
UploadDirectory: "osbuild-composer-koji-" + uuid.New().String(),
|
||||
Server: request.Koji.Server,
|
||||
KojiFilename: ir.kojiFilename,
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
id, err := h.server.workers.Enqueue(ir.arch, &job)
|
||||
if err != nil {
|
||||
// This is a programming errror.
|
||||
panic(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue