Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic schema cache #129

Merged
merged 1 commit into from
Jun 9, 2019
Merged

Conversation

johanneswuerbach
Copy link
Contributor

@johanneswuerbach johanneswuerbach commented May 27, 2019

When passing in multiple files each schema is downloaded multiple times.

This PR introduces a simple in-memory cache to download required schemas only once during a validation run.

It uses the approach described in https://github.com/xeipuuv/gojsonschema/blob/master/README.md#validation to share load the schema only once.

This reduces the validation time of our ~1k yaml files from 5 mins to ~10s.

@garethr
Copy link
Collaborator

garethr commented Jun 9, 2019

@johanneswuerbach this is great, much appreciated. I'll try this out and get a new release of kubeval out with this. Thanks for the functionality and the tests too.

@garethr garethr merged commit bc9ab56 into instrumenta:master Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants