mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
Fix #5956 issue: The APIs should not get chart information when Harbor is not installed with chart repo
Signed-off-by: Steven Zou <szou@vmware.com>
This commit is contained in:
parent
6c00747390
commit
55c50f310d
@ -420,13 +420,15 @@ func (p *ProjectAPI) populateProperties(project *models.Project) {
|
||||
project.RepoCount = total
|
||||
|
||||
// Populate chart count property
|
||||
count, err := chartController.GetCountOfCharts([]string{project.Name})
|
||||
if err != nil {
|
||||
log.Errorf("Failed to get total of charts under project %s: %v", project.Name, err)
|
||||
p.CustomAbort(http.StatusInternalServerError, "")
|
||||
}
|
||||
if config.WithChartMuseum() {
|
||||
count, err := chartController.GetCountOfCharts([]string{project.Name})
|
||||
if err != nil {
|
||||
log.Errorf("Failed to get total of charts under project %s: %v", project.Name, err)
|
||||
p.CustomAbort(http.StatusInternalServerError, "")
|
||||
}
|
||||
|
||||
project.ChartCount = count
|
||||
project.ChartCount = count
|
||||
}
|
||||
}
|
||||
|
||||
// Put ...
|
||||
|
Loading…
Reference in New Issue
Block a user