зеркало из https://github.com/mozilla/scribe.git
Fixed the error field in shortVulnResponse
This commit is contained in:
Родитель
7b7ef711bd
Коммит
fb71baf557
|
@ -20,11 +20,16 @@ const (
|
|||
clairGetVulnsEndptFmt string = "http://127.0.0.1:6060/v1/namespaces/%s/vulnerabilities/%s?fixedIn"
|
||||
)
|
||||
|
||||
// errorMessage contains error data that the Clair API may return.
|
||||
type errorMessage struct {
|
||||
Message string `json:"Message"`
|
||||
}
|
||||
|
||||
// shortVulnResponse contains the response data we expect from a request for a
|
||||
// list of vulnerabilities for a namespace.
|
||||
type shortVulnResponse struct {
|
||||
Vulns []shortVuln `json:"Vulnerabilities"`
|
||||
Error *string `json:"Error"`
|
||||
Error *errorMessage `json:"Error"`
|
||||
NextPage string `json:"NextPage"`
|
||||
}
|
||||
|
||||
|
@ -83,7 +88,7 @@ func listVulnsForNamespace(namespace string) ([]shortVuln, error) {
|
|||
}
|
||||
|
||||
if respData.Error != nil {
|
||||
return []shortVuln{}, errors.New(*respData.Error)
|
||||
return []shortVuln{}, errors.New(respData.Error.Message)
|
||||
}
|
||||
|
||||
if respData.NextPage == "" {
|
||||
|
|
Загрузка…
Ссылка в новой задаче