Skip to content

Commit

Permalink
Merge pull request #4389 from pedjak/use-chart-proxy-in-ui
Browse files Browse the repository at this point in the history
Retrieve the list of Helm charts via chart repo proxy endpoint
  • Loading branch information
openshift-merge-robot committed Mar 2, 2020
2 parents 44d2165 + 7de25fa commit 7e59754
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 5 additions & 7 deletions frontend/public/components/catalog/catalog-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,11 @@ export const Catalog = connectToFlags<CatalogProps>(
}, [loadTemplates, namespace]);

React.useEffect(() => {
coFetch('https://redhat-developer.github.io/redhat-helm-charts/index.yaml').then(
async (res) => {
const yaml = await res.text();
const json = safeLoad(yaml);
setHelmCharts(json.entries);
},
);
coFetch('/api/helm/charts/index.yaml').then(async (res) => {
const yaml = await res.text();
const json = safeLoad(yaml);
setHelmCharts(json.entries);
});
}, []);

const error = templateError || projectTemplateError;
Expand Down
2 changes: 1 addition & 1 deletion pkg/helm/chartproxy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func RegisterFlags(fs *flag.FlagSet) *config {

cfg := new(config)

fs.StringVar(&cfg.repoUrl, "helm-chart-repo-url", "https://redhat-developer.github.com/redhat-helm-charts", "Helm chart repository URL")
fs.StringVar(&cfg.repoUrl, "helm-chart-repo-url", "https://redhat-developer.github.io/redhat-helm-charts", "Helm chart repository URL")
fs.StringVar(&cfg.repoCaFile, "helm-chart-repo-ca-file", "", "CA bundle for Helm chart repository.")

return cfg
Expand Down
3 changes: 2 additions & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ func (s *Server) HTTPHandler() http.Handler {

helmChartRepoProxy := proxy.NewProxy(s.HelmChartRepoProxyConfig)

handle(helmChartRepoProxyEndpoint, http.StripPrefix(
// Only proxy requests to chart repo index file
handle(helmChartRepoProxyEndpoint+"index.yaml", http.StripPrefix(
proxy.SingleJoiningSlash(s.BaseURL.Path, helmChartRepoProxyEndpoint),
http.HandlerFunc(helmChartRepoProxy.ServeHTTP)))

Expand Down

0 comments on commit 7e59754

Please sign in to comment.