worker/server: add file resolver job
Add a file resolver job to the worker server in order for us to resolve the contents of a remote file.
This commit is contained in:
parent
98d611d34f
commit
c056db4811
2 changed files with 61 additions and 1 deletions
|
|
@ -89,6 +89,18 @@ func (j *OSBuildJobResult) TargetResultsByName(name target.TargetName) []*target
|
|||
return targetResults
|
||||
}
|
||||
|
||||
func (j *FileResolveJobResult) ResolutionErrors() []*clienterrors.Error {
|
||||
resolutionErrors := []*clienterrors.Error{}
|
||||
|
||||
for _, result := range j.Results {
|
||||
if result.ResolutionError != nil {
|
||||
resolutionErrors = append(resolutionErrors, result.ResolutionError)
|
||||
}
|
||||
}
|
||||
|
||||
return resolutionErrors
|
||||
}
|
||||
|
||||
type KojiInitJob struct {
|
||||
Server string `json:"server"`
|
||||
Name string `json:"name"`
|
||||
|
|
@ -256,6 +268,22 @@ type ContainerResolveJobResult struct {
|
|||
JobResult
|
||||
}
|
||||
|
||||
type FileResolveJob struct {
|
||||
URLs []string `json:"urls"`
|
||||
}
|
||||
|
||||
type FileResolveJobResultItem struct {
|
||||
URL string `json:"url"`
|
||||
Content []byte `json:"content"`
|
||||
ResolutionError *clienterrors.Error `json:"target_error,omitempty"`
|
||||
}
|
||||
|
||||
type FileResolveJobResult struct {
|
||||
Success bool `json:"success"`
|
||||
Results []FileResolveJobResultItem `json:"results"`
|
||||
JobResult
|
||||
}
|
||||
|
||||
type OSTreeResolveSpec struct {
|
||||
URL string `json:"url"`
|
||||
Ref string `json:"ref"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue