mirror of
https://github.com/goharbor/harbor.git
synced 2024-10-27 13:49:34 +01:00
api should return 503 when Harbor is not deployed with clair, and add more comments
This commit is contained in:
parent
41346fe8c0
commit
04b9ee5cfd
@ -620,8 +620,13 @@ func (ra *RepositoryAPI) GetSignatures() {
|
|||||||
ra.ServeJSON()
|
ra.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
//ScanImage handles
|
//ScanImage handles request POST /api/repository/$repository/tags/$tag/scan to trigger image scan manually.
|
||||||
func (ra *RepositoryAPI) ScanImage() {
|
func (ra *RepositoryAPI) ScanImage() {
|
||||||
|
if !config.WithClair() {
|
||||||
|
logger.Warningf("Harbor is not deployed with Clair, scan is disabled.")
|
||||||
|
ra.RenderError(http.StatusServiceUnavailable, "")
|
||||||
|
return
|
||||||
|
}
|
||||||
repoName := ra.GetString(":splat")
|
repoName := ra.GetString(":splat")
|
||||||
tag := ra.GetString(":tag")
|
tag := ra.GetString(":tag")
|
||||||
projectName, _ := utils.ParseRepository(repoName)
|
projectName, _ := utils.ParseRepository(repoName)
|
||||||
|
Loading…
Reference in New Issue
Block a user