forked from elastic/cloud-on-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove "all" namespace from managed namespaces (elastic#5187)
* Don't append the 'all' namespaces when storage class validation is enabled, as it causes 'unknown namespace' errors in controller-runtime, and cluster-scoped resources are handled properly now in ctrl-runtime. see kubernetes-sigs/controller-runtime#1418 * Webhook ignores requests from namespaces that it doesn't manage Updates webhook tests to ensure behavior. * remove spaces in if err block move log line down for consistency * Move namespace validation within the Handle func to reduce duplication. * ES spelling in pkg/controller/elasticsearch/validation/webhook.go Co-authored-by: Peter Brachwitz <peter.brachwitz@gmail.com> * ES spelling in pkg/controller/elasticsearch/validation/webhook.go Co-authored-by: Peter Brachwitz <peter.brachwitz@gmail.com> * Use set operations to enhance readability. * Create new package to duplicate less code for setting up webhooks, and to allow managedNamespaces in webhooks to be handled properly across all webhooks. Adjust all managed objects to use new webhook package on setup. * Adjust common webhook to copy object properly, and use metav1.Object to query namespace. Add logging when skipping resource validation. Add additional information to 'reason' for allowing request. * add missing header * Check type assertion. * Ensure that the set of managed namespaces isn't all before checking whether the given namespaces is managed. * Simplify common webhook validation Adjust how update is handled * Remove debugging from webhook * Proper casing in comments. Decode the old object in upgrade, not the original object. * Adding unit tests for webhook validation. * Use keys in the webhook test structs Co-authored-by: Peter Brachwitz <peter.brachwitz@gmail.com>
- Loading branch information
1 parent
8c9c955
commit a4cd98d
Showing
15 changed files
with
533 additions
and
83 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.