Add support for creating repository indexes in JSON format #739
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does
Adds support for generating an index.yaml in JSON-format to improve parsing performance (client-side) by using the default json library. Related to helm/helm#12245 and #738.
Testing results
When templating releases for my personal projects, I noticed a ~27% speed improvement in direct comparison of the chartmuseum creating a YAML-formatted versus a JSON-formatted index.yaml.
To be specific, a (rather large) Helmfile release used to take around 6min38s (user time), now takes 5m12s.
What was changed
A flag was added (
--json-index
) which defaults tofalse
. When set totrue
chartmuseum will return theindex.yaml
with JSON-formatted content, as described in the PR mentionned above.This change should be backwards compatible with all Helm-clients before 3.13.0, since YAML is a superset of JSON, meaning all JSON can be parsed using YAML parsers. To be able to fully take advantage of the performance improvement the client will have to be updated to Helm >3.13.0.