Deduplicate Admission Webhooks - #497
Merged
Merged
Conversation
Defining admission webhooks for each version of the same resource results in duplicate webhook calls for the same admission request. The resource is converted to each version as that version's webhook is called. Fortunately these calls were made in parallel, so there was minimal latency added for users, but the extra calls are just wasting resources. We now only register admission webhooks for the v1 version of the resources. API requests using the v1beta1 or v1alpha3 versions are converted to the v1 by the API server and then called using the v1 webhook endpoint. Signed-off-by: Scott Andrews <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #497 +/- ##
==========================================
+ Coverage 65.27% 72.06% +6.78%
==========================================
Files 32 28 -4
Lines 2039 1872 -167
==========================================
+ Hits 1331 1349 +18
+ Misses 637 452 -185
Partials 71 71 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Scott Andrews <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Defining admission webhooks for each version of the same resource results in duplicate webhook calls for the same admission request. The resource is converted to each version as that version's webhook is called. Fortunately these calls were made in parallel, so there was minimal latency added for users, but the extra calls are just wasting resources.
We now only register admission webhooks for the v1 version of the resources. API requests using the v1beta1 or v1alpha3 versions are converted to the v1 by the API server and then called using the v1 webhook endpoint.