Skip to content

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