-
Notifications
You must be signed in to change notification settings - Fork 1
[feature] application hooks #85
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
base: main
Are you sure you want to change the base?
Conversation
d5d34b8 to
a8472f1
Compare
Signed-off-by: Stepan Paksashvili <[email protected]>
4455b24 to
7bd80ba
Compare
Signed-off-by: Stepan Paksashvili <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces support for application hooks alongside existing module hooks, implementing a generic hook system using Go generics. The main additions include ApplicationHookInput with namespace-scoped operations via NamespacedPatchCollector, and a dedicated ApplicationDependencyContainer interface.
Changes:
- Introduced generic
Hook[T Input]type supporting both module and application hooks - Added
ApplicationHookInputwithInstanceinterface for application context andNamespacedPatchCollectorfor namespace-scoped Kubernetes operations - Refactored internal architecture with new executor abstraction layer (
moduleExecutorandapplicationExecutor)
Reviewed changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/hook.go | Introduced generic Hook type with ApplicationHookInput and Instance interface |
| pkg/dependency.go | Added ApplicationDependencyContainer interface (subset of DependencyContainer) |
| pkg/patch.go | Added NamespacedPatchCollector interface and removed deprecated type aliases |
| pkg/registry/registry.go | Refactored to support generic hook registration with type-based routing |
| internal/executor/*.go | New executor abstraction with separate module and application implementations |
| internal/objectpatch/*.go | Implemented PatchCollector and NamespacedPatchCollector with operation types |
| internal/controller/controller.go | Updated to use executor registry instead of direct hook registry |
| examples/single-file-app-example/ | New example demonstrating application hook usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Stepan Paksashvili <[email protected]>
It provides ApplicationHookInput with NamespacedObjectPatchCollector and ApplicationDependencyContainer