Skip to content

Commit

Permalink
Added ability to disable query to ArtifactHub via env (#515)
Browse files Browse the repository at this point in the history
It is now possible to disable the query through environment variable HD_NO_ARTIFACT_HUB_QUERY
  • Loading branch information
alessandrodetta authored Feb 23, 2024
1 parent b5bed10 commit 274f1cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/dashboard/handlers/helmHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 274f1cd

Please sign in to comment.