cloudapi: Omit details in compose status job error if nil
This commit is contained in:
parent
7b73cf395f
commit
24fab1d5b9
3 changed files with 7 additions and 8 deletions
|
|
@ -722,11 +722,14 @@ func composeStatusErrorFromJobError(jobError *clienterrors.Error) *ComposeStatus
|
|||
if jobError == nil {
|
||||
return nil
|
||||
}
|
||||
return &ComposeStatusError{
|
||||
Id: int(jobError.ID),
|
||||
Reason: jobError.Reason,
|
||||
Details: &jobError.Details,
|
||||
err := &ComposeStatusError{
|
||||
Id: int(jobError.ID),
|
||||
Reason: jobError.Reason,
|
||||
}
|
||||
if jobError.Details != nil {
|
||||
err.Details = &jobError.Details
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func imageStatusFromOSBuildJobStatus(js *worker.JobStatus, result *worker.OSBuildJobResult) ImageStatusValue {
|
||||
|
|
|
|||
|
|
@ -215,7 +215,6 @@ func TestKojiCompose(t *testing.T) {
|
|||
"image_status": {
|
||||
"status": "failure",
|
||||
"error": {
|
||||
"details": null,
|
||||
"id": 10,
|
||||
"reason": "Koji build error"
|
||||
}
|
||||
|
|
@ -224,7 +223,6 @@ func TestKojiCompose(t *testing.T) {
|
|||
{
|
||||
"status": "failure",
|
||||
"error": {
|
||||
"details": null,
|
||||
"id": 10,
|
||||
"reason": "Koji build error"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -720,7 +720,6 @@ func TestComposeStatusFailure(t *testing.T) {
|
|||
"image_status": {
|
||||
"error": {
|
||||
"id": 10,
|
||||
"details": null,
|
||||
"reason": "osbuild build failed"
|
||||
},
|
||||
"status": "failure"
|
||||
|
|
@ -798,7 +797,6 @@ func TestComposeJobError(t *testing.T) {
|
|||
"image_status": {
|
||||
"error": {
|
||||
"id": 10,
|
||||
"details": null,
|
||||
"reason": "Error building image"
|
||||
},
|
||||
"status": "failure"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue