mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
Optimize single release getting (#373)
* Optimize single release getting * Disable unused releases getting * fix build * Remove unused code completely
This commit is contained in:
@@ -23,7 +23,6 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
"helm.sh/helm/v3/pkg/chartutil"
|
||||
"helm.sh/helm/v3/pkg/release"
|
||||
"helm.sh/helm/v3/pkg/repo"
|
||||
helmtime "helm.sh/helm/v3/pkg/time"
|
||||
"k8s.io/utils/strings/slices"
|
||||
)
|
||||
@@ -278,14 +277,6 @@ func (h *HelmHandler) RepoCharts(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
installed, err := app.Releases.List()
|
||||
if err != nil {
|
||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
enrichRepoChartsWithInstalled(charts, installed)
|
||||
|
||||
sort.Slice(charts, func(i, j int) bool {
|
||||
return charts[i].Name < charts[j].Name
|
||||
})
|
||||
@@ -293,19 +284,6 @@ func (h *HelmHandler) RepoCharts(c *gin.Context) {
|
||||
c.IndentedJSON(http.StatusOK, charts)
|
||||
}
|
||||
|
||||
func enrichRepoChartsWithInstalled(charts []*repo.ChartVersion, installed []*objects.Release) {
|
||||
for _, rchart := range charts {
|
||||
for _, rel := range installed {
|
||||
if rchart.Metadata.Name == rel.Orig.Chart.Name() {
|
||||
log.Debugf("Matched") // TODO: restore implementation
|
||||
// TODO: there can be more than one
|
||||
//rchart.InstalledNamespace = rel.Orig.Namespace
|
||||
//rchart.InstalledName = rel.Orig.Name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (h *HelmHandler) RepoUpdate(c *gin.Context) {
|
||||
app := h.GetApp(c)
|
||||
if app == nil {
|
||||
|
||||
Reference in New Issue
Block a user