cloudapi/v2: support logs/manifests endpoints

For now these only work for koji builds.
This commit is contained in:
Tom Gundersen 2022-01-27 16:21:50 +00:00
parent b32ab36e1d
commit c81d0d08ec
4 changed files with 369 additions and 63 deletions

View file

@ -247,6 +247,19 @@ func (s *Server) ManifestByIdJobStatus(id uuid.UUID, result *ManifestJobByIDResu
return status, deps, nil
}
func (s *Server) ManifestJobStatus(id uuid.UUID, result *ManifestJobByIDResult) (*JobStatus, []uuid.UUID, error) {
jobType, status, deps, err := s.jobStatus(id, result)
if err != nil {
return nil, nil, err
}
if jobType != "manifest-job-by-id" {
return nil, nil, fmt.Errorf("expected \"manifest-job-by-id\", found %q job instead", jobType)
}
return status, deps, nil
}
func (s *Server) jobStatus(id uuid.UUID, result interface{}) (string, *JobStatus, []uuid.UUID, error) {
jobType, rawResult, queued, started, finished, canceled, deps, err := s.jobs.JobStatus(id)
if err != nil {