In case no repositories configured, fall back to empty search

This commit is contained in:
Andrei Pohilko
2022-11-24 16:25:30 +00:00
parent 7de7c85426
commit 3384db7193

View File

@@ -68,7 +68,11 @@ func (d *DataLayer) ChartRepoVersions(chartName string) (res []*RepoChartElement
return d.runCommandHelm(cmd...) return d.runCommandHelm(cmd...)
}) })
if err != nil { if err != nil {
return nil, err if strings.Contains(err.Error(), "no repositories configured") {
out = "[]"
} else {
return nil, err
}
} }
err = json.Unmarshal([]byte(out), &res) err = json.Unmarshal([]byte(out), &res)