forked from kubernetes-retired/hierarchical-namespaces
-
Notifications
You must be signed in to change notification settings - Fork 2
Replace webhook implementation with WebhookManagedBy. #27
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
Draft
ryotarai
wants to merge
12
commits into
pfnet:master
Choose a base branch
from
ryotarai:ryotarai/WebhookManagedBy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…By." This reverts commit 8211c57.
Updates the hncconfig validator to use the modern WebhookManagedBy pattern instead of manual webhook registration, following the same approach used for HierarchyConfiguration. Changes: - Add NewValidator constructor function - Replace Handle method with ValidateCreate/Update/Delete methods - Convert internal validation logic to return errors instead of admission responses - Update webhook registration in setup/webhooks.go to use WebhookManagedBy - Update tests to use new API and remove unused logResult function 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Updates the anchor (SubnamespaceAnchor) validator to use the modern WebhookManagedBy pattern instead of manual webhook registration. Changes: - Add NewValidator constructor function - Replace Handle method with ValidateCreate/Update/Delete methods - Convert internal validation logic to return errors instead of admission responses - Update webhook registration in setup/webhooks.go to use WebhookManagedBy - Update tests to use new handleValidation method and remove unused logResult function 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Updates the namespace validator to use the modern WebhookManagedBy pattern instead of manual webhook registration. Changes: - Add NewValidator constructor function - Replace Handle method with ValidateCreate/Update/Delete methods - Convert internal validation logic to return errors instead of admission responses - Update all validation methods to return errors - Update webhook registration in setup/webhooks.go to use WebhookManagedBy - Update tests to use new handleValidation method and remove unused logResult function 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Updates the namespace mutator to use the modern WebhookManagedBy pattern instead of manual webhook registration. Changes: - Add NewMutator constructor function - Replace Handle method with Default method for the defaulter interface - Rename internal handle method to mutateNamespace - Update webhook registration in setup/webhooks.go to use WebhookManagedBy with WithDefaulter - Update tests to use new mutateNamespace method - Remove unused imports and InjectDecoder method 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Convert ResourceQuotaStatus to use ValidateCreate/Update/Delete methods instead of Handle - Add NewResourceQuotaStatus constructor with client and forest parameters - Update validateResourceQuotaStatus to return errors instead of admission responses - Add helper functions for admission responses (allow, deny, denyInvalidField, codeFromReason) - Update tests to use validateHRQResourceQuotaStatus method directly - Remove old injection methods (InjectClient, InjectDecoder) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Convert HRQ to use ValidateCreate/Update/Delete methods instead of Handle - Add NewHRQ constructor with client parameter for dry-run client setup - Update validate method to return errors instead of admission responses - Convert validation to use apierrors.NewInvalid with field validation - Update tests to use validate method directly with error checking - Remove old injection methods (InjectClient, InjectDecoder) - Add missing imports for field validation and runtime types 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…a and HierarchicalResourceQuota. - Replace manual webhook registration with builder.WebhookManagedBy() pattern - Use NewResourceQuotaStatus constructor for ResourceQuota webhook - Use NewHRQ constructor for HierarchicalResourceQuota webhook - Add proper error handling for webhook creation - Remove old manual injection and registration code 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ok creation accordingly
Confirmed the validator for HierarchyConfiguration works:
|
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.
Replace objects validator too.fixes #20