Skip to content

Commit

Permalink
Retrieve the list of Helm charts via chart repo proxy endpoint
Browse files Browse the repository at this point in the history
The reverse proxy obtained via httputil.NewSingleHostReverseProxy does not follow redirects,
and returns such requests to UI causing CORS issue, failing to load index.yaml from UI.

Our default repo redhat-developer.github.com redirects to redhat-developer.github.io and in order
to fix index.yaml loading, we started to use redhat-developer.github.io
  • Loading branch information
pedjak committed Feb 21, 2020
1 parent d8cecd9 commit 67580b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 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

0 comments on commit 67580b4

Please sign in to comment.