worker: always send status "FINISHED"
The server hasn't used common.ImageBuildState to mark a job as successful or failed for a long time. Instead, it's using the job's return argument for that. (Jobs don't have a high-level concept of failing). Drop the check in the server, and always send "FINISHED" from the client for backwards compatibility.
This commit is contained in:
parent
b7cb2cff62
commit
d1f322ec6f
3 changed files with 4 additions and 15 deletions
|
|
@ -28,7 +28,7 @@ type Client struct {
|
|||
type Job interface {
|
||||
Id() uuid.UUID
|
||||
OSBuildArgs() (distro.Manifest, []*target.Target, error)
|
||||
Update(status common.ImageBuildState, result *osbuild.Result) error
|
||||
Update(result *osbuild.Result) error
|
||||
Canceled() (bool, error)
|
||||
UploadArtifact(name string, reader io.Reader) error
|
||||
}
|
||||
|
|
@ -154,11 +154,11 @@ func (j *job) OSBuildArgs() (distro.Manifest, []*target.Target, error) {
|
|||
return args.Manifest, args.Targets, nil
|
||||
}
|
||||
|
||||
func (j *job) Update(status common.ImageBuildState, result *osbuild.Result) error {
|
||||
func (j *job) Update(result *osbuild.Result) error {
|
||||
var buf bytes.Buffer
|
||||
err := json.NewEncoder(&buf).Encode(api.UpdateJobJSONRequestBody{
|
||||
Result: result,
|
||||
Status: status.ToString(),
|
||||
Status: "FINISHED",
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue