Skip to content

Conversation

@harshadixit12
Copy link
Contributor

@harshadixit12 harshadixit12 commented Jan 5, 2026

Summary

In this PR, we are adding support for Event Gateway Control Planes.
The implementation includes:

  1. Declarative management, protection for the EGW control planes
  2. Imperative Get (list, list by name, get by ID, get by Name)
  3. Adopt
  4. Dump
  5. Plan - both apply and sync mode
  6. e2e tests (containing plan, apply, sync and protection changes scenarios)

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:

go run main.go get event-gateway
(OR)
go run main.go get egw

To try declarative:
In egw.yaml

event_gateways:
- name: egw-control-plane-2
  kongctl:
    protected: true
    namespace: test-ns

go run main.go apply -f egw.yaml --pat {token}

Issues resolved

Implement #200

Documentation

Testing

  • Unit tests (some - for adopt command)
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

@harshadixit12 harshadixit12 force-pushed the feat/event-gateway-control-plane branch from 73e4544 to 240a79e Compare January 6, 2026 15:27
@harshadixit12
Copy link
Contributor Author

Few callouts:

  1. I'm running into some mocking issues in existing unit / integration tests, actively working on fixing them.
  2. Some files are copy pasted from other resource types - might have their original names in comments, will be cleaned up.
  3. I have prioritised functionality over code quality & refactoring - iterative improvement needed here.

@harshadixit12 harshadixit12 marked this pull request as ready for review January 7, 2026 14:23
Copilot AI review requested due to automatic review settings January 7, 2026 14:23
Copy link
Contributor

Copilot AI left a 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.

@harshadixit12 harshadixit12 force-pushed the feat/event-gateway-control-plane branch from d7673b6 to fbac7f8 Compare January 8, 2026 11:04
@harshadixit12 harshadixit12 force-pushed the feat/event-gateway-control-plane branch from 4a3c0cc to 3f762d5 Compare January 9, 2026 14:26
@rspurgeon
Copy link
Collaborator

@harshadixit12 could you add testing that uses the kongctl plan workflow? Either in a new scenario or in the current one, so that we're sure the kongctl plan | kongctl apply|sync flow works which is key.

@harshadixit12
Copy link
Contributor Author

@harshadixit12 could you add testing that uses the kongctl plan workflow? Either in a new scenario or in the current one, so that we're sure the kongctl plan | kongctl apply|sync flow works which is key.

@rspurgeon this is already added to scenarios/plan for both apply and sync here - 169d4bc#diff-9102d58a1a2976010b48ae8b60213a638665a42516910b3066c00f7893113c2b - let me know if I should create a new scenario

@rspurgeon
Copy link
Collaborator

@harshadixit12 could you add testing that uses the kongctl plan workflow? Either in a new scenario or in the current one, so that we're sure the kongctl plan | kongctl apply|sync flow works which is key.

@rspurgeon this is already added to scenarios/plan for both apply and sync here - 169d4bc#diff-9102d58a1a2976010b48ae8b60213a638665a42516910b3066c00f7893113c2b - let me know if I should create a new scenario

Sorry, I missed that. I see you added it to that general plan scenario. This is fine, but I do think we want a dedicated plan driven scenario for EGWs specifically as well or move that into a dedicated test/e2e/scenarios/event-gateway/plan which we can add more to as we expand the child resources for EGWs

@harshadixit12
Copy link
Contributor Author

@harshadixit12 could you add testing that uses the kongctl plan workflow? Either in a new scenario or in the current one, so that we're sure the kongctl plan | kongctl apply|sync flow works which is key.

@rspurgeon this is already added to scenarios/plan for both apply and sync here - 169d4bc#diff-9102d58a1a2976010b48ae8b60213a638665a42516910b3066c00f7893113c2b - let me know if I should create a new scenario

Sorry, I missed that. I see you added it to that general plan scenario. This is fine, but I do think we want a dedicated plan driven scenario for EGWs specifically as well or move that into a dedicated test/e2e/scenarios/event-gateway/plan which we can add more to as we expand the child resources for EGWs

Makes sense, i'll move it into a dedicated scenario 👍

@harshadixit12
Copy link
Contributor Author

@rspurgeon plan-apply and plan-sync scenarios added for event gateway here - tests: add separate event gateway planning scenarios

@rspurgeon rspurgeon merged commit df05a5c into main Jan 14, 2026
10 checks passed
@rspurgeon rspurgeon deleted the feat/event-gateway-control-plane branch January 14, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants