mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 03:38:04 +00:00
Added ability to disable query to ArtifactHub via env (#515)
It is now possible to disable the query through environment variable HD_NO_ARTIFACT_HUB_QUERY
This commit is contained in:
@@ -241,6 +241,11 @@ func (h *HelmHandler) RepoLatestVer(c *gin.Context) {
|
||||
if len(res) > 0 {
|
||||
c.IndentedJSON(http.StatusOK, res[:1])
|
||||
} else {
|
||||
if utils.EnvAsBool("HD_NO_ARTIFACT_HUB_QUERY", false) {
|
||||
c.Status(http.StatusNoContent)
|
||||
return
|
||||
}
|
||||
|
||||
// caching it to avoid too many requests
|
||||
found, err := h.Data.Cache.String("chart-artifacthub-query/"+qp.Name, nil, func() (string, error) {
|
||||
return h.repoFromArtifactHub(qp.Name)
|
||||
|
||||
Reference in New Issue
Block a user