Cache schema misses if missing schemas allowed #210
Merged
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.
I've noticed that kubeval was MUCH slower after upgrading from 0.11.0 to 0.14.0. It turns out the schema server kubeval is hitting is very slow in returning 404s (like 15-30 seconds), so if you have a lot of custom resources, you're going to be waiting a long time if there's no caching. While it would be nice to make the server faster, there's no reason to not cache the schema misses.
I noticed that there was a commented-out line that explained why it wasn't done, so I modified a test to reproduce the error mentioned in the comment and then changed the code to fix the nil reference.