chartmuseum icon indicating copy to clipboard operation
chartmuseum copied to clipboard

Changes to chart-url do not affect the index-cache file

Open alekc opened this issue 5 years ago • 2 comments

Similar to https://github.com/helm/chartmuseum/issues/157 (or pretty much the same).

The current behavior of the --chart-url is very confusing. If it is set, all packages in the index.yaml have absolute url in their name, and that behavior is absolutely correct.

However, if that variable is changed (let's say you have decided to migrate your chart museum to another domain), old values are not affected, so potentially you will be serving URLs that point to non-existing domains.

If a new package is uploaded, then it would be stored with a new url, but all other packages will maintain the old one.

What we can potentially do, is (if the chart-url is enabled) to scan the index-cache.yaml file, and as long as there is at least one package with a wrong prefix (!= chat-url), then force regeneration if the cache file.

Such operation could be performed on the application startup (however I am not sure about possible concurrency issue).

I can pick this task, as long as we come to an agreement about the path to take.

alekc avatar Oct 08 '20 20:10 alekc

I think index-cache should be invalidated if the chart-url setting changes.. just a matter of how to detect this. @alekc if you can find a reliable way, then by all means I think this would be good PR

jdolitsky avatar Oct 14 '20 23:10 jdolitsky

Ok, I will have a look.

alekc avatar Oct 16 '20 09:10 alekc