-
Notifications
You must be signed in to change notification settings - Fork 12
Feat/event gateway control plane #314
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
Conversation
73e4544 to
240a79e
Compare
test/e2e/testdata/declarative/event-gateways/comprehensive-fields/event-gateways.yaml
Outdated
Show resolved
Hide resolved
|
Few callouts:
|
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 PR implements support for Event Gateway Control Planes in kongctl, adding both imperative (get/list) and declarative (apply/sync) management capabilities. The implementation follows the existing patterns in the codebase for similar resources like portals and APIs.
Key Changes:
- Added complete CRUD operations for Event Gateway Control Planes through declarative configuration files
- Implemented imperative get commands with support for listing, fetching by ID, and fetching by name
- Added comprehensive e2e tests covering creation, updates, deletion, and resource protection scenarios
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
internal/konnect/helpers/sdk.go |
Added GetEventGatewayControlPlaneAPI method to expose EGW control plane API |
internal/konnect/helpers/sdk_mock.go |
Added mock factory for Event Gateway Control Plane API in tests |
internal/konnect/helpers/event_gateway_control_plane.go |
Implemented EGWControlPlaneAPI interface wrapping SDK calls |
internal/declarative/state/client.go |
Added Event Gateway Control Plane CRUD operations to state client |
internal/declarative/resources/types.go |
Added EventGatewayControlPlane resource type constant and field to ResourceSet |
internal/declarative/resources/event_gateway_control_plane.go |
Implemented EventGatewayControlPlaneResource with validation and matching logic |
internal/declarative/planner/planner.go |
Integrated Event Gateway Control Plane planner into main planning flow |
internal/declarative/planner/interfaces.go |
Defined EGWControlPlanePlanner interface |
internal/declarative/planner/egw_control_plane_planner.go |
Implemented planning logic for EGW control planes with protection support |
internal/declarative/planner/base_planner.go |
Added helper method to retrieve desired Event Gateway Control Planes |
internal/declarative/planner/planner_test.go |
Updated all planner tests to mock Event Gateway Control Plane API |
internal/declarative/planner/resolver_test.go |
Added mock implementation for Event Gateway Control Plane API |
internal/declarative/executor/executor.go |
Added Event Gateway Control Plane executor and routing for CRUD operations |
internal/declarative/executor/event_gateway_control_plane_adapter.go |
Implemented adapter for mapping between planner and state client |
internal/declarative/loader/loader.go |
Added loading and validation logic for Event Gateway Control Planes |
internal/declarative/labels/labels.go |
Added helper function to convert pointer maps to string maps |
internal/cmd/root/verbs/get/get.go |
Added Event Gateway command to root get verb |
internal/cmd/root/verbs/get/eventgateway.go |
Implemented direct Event Gateway command for Konnect-first usage |
internal/cmd/root/products/konnect/konnect.go |
Integrated Event Gateway command into Konnect product hierarchy |
internal/cmd/root/products/konnect/eventgateway/event-gateway.go |
Created Event Gateway command group with aliases |
internal/cmd/root/products/konnect/eventgateway/control-plane/controlplane.go |
Defined control-plane subcommand structure |
internal/cmd/root/products/konnect/eventgateway/control-plane/getControlPlane.go |
Implemented get/list operations with pagination and filtering |
internal/cmd/root/products/konnect/declarative/declarative.go |
Updated resource counting to include Event Gateway Control Planes |
test/e2e/testdata/declarative/protected/event-gateways.yaml |
Test data for protected Event Gateway Control Plane scenarios |
test/e2e/testdata/declarative/event-gateways/comprehensive-fields/event-gateways.yaml |
Test data for comprehensive field testing |
test/e2e/scenarios/event-gateway/control-planes/scenario.yaml |
E2E test scenario for basic CRUD operations |
test/e2e/scenarios/event-gateway/control-planes/overlays/*.yaml |
Test overlays for update and delete scenarios |
test/e2e/scenarios/protected-resources/event-gateways/scenario.yaml |
E2E test scenario for resource protection behavior |
test/e2e/scenarios/protected-resources/event-gateways/overlays/*.yaml |
Test overlays for protection scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/declarative/executor/event_gateway_control_plane_adapter.go
Outdated
Show resolved
Hide resolved
internal/declarative/executor/event_gateway_control_plane_adapter.go
Outdated
Show resolved
Hide resolved
internal/declarative/executor/event_gateway_control_plane_adapter.go
Outdated
Show resolved
Hide resolved
d7673b6 to
fbac7f8
Compare
…me for Event Gateway control planes
4a3c0cc to
3f762d5
Compare
|
@harshadixit12 could you add testing that uses the |
@rspurgeon this is already added to |
Sorry, I missed that. I see you added it to that general |
Makes sense, i'll move it into a dedicated scenario 👍 |
|
@rspurgeon plan-apply and plan-sync scenarios added for event gateway here - tests: add separate event gateway planning scenarios |
Summary
In this PR, we are adding support for Event Gateway Control Planes.
The implementation includes:
The implementation is human-written for the purpose of understanding the structure of codebase.
Copilot was used to clean up comments, linting etc.
To try out imperative:
To try declarative:
In
egw.yamlgo run main.go apply -f egw.yaml --pat {token}Issues resolved
Implement #200
Documentation
Testing
adoptcommand)