Skip to content

feat(KonnectGatewayControlPlane)!: add v1alpha2 version of KonnectGatewayControlPlane #502

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

Merged
merged 3 commits into from
Jul 22, 2025

Conversation

alacuku
Copy link
Contributor

@alacuku alacuku commented Jul 4, 2025

What this PR does / why we need it:
KonnectGatewayControlPlane v1alpha2 has been introduced.
The CreateControlPlaneRequest fields (name, description, clusterType, authType, cloudGateway, proxyUrls, labels) have been moved from the top level of spec into a new structured field: spec.createControlPlaneRequest.

Action required:

  • Update any manifests or code that reference these fields to use the new nested structure, e.g.:
spec:
  createControlPlaneRequest:
    name: my-control-plane
    clusterType: CLUSTER_TYPE_CONTROL_PLANE
    # ...other fields...
  • The old flat field layout is no longer supported in v1alpha2.

Which issue this PR fixes

Fixes:

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect significant changes

@alacuku
Copy link
Contributor Author

alacuku commented Jul 4, 2025

These test failures for KonnectGatewayControlPlane v1alpha1 are related to the CRD's storage version (v1alpha2) and the absence of a conversion method between versions:

=== Failed
=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane/updates_not_allowed_for_status_conditions/konnect.authRef_change_is_allowed_when_cp_is_not_Programmed=True_nor_APIAuthValid=True (1.10s)
    testcase.go:165: 
                Error Trace:    /home/aldo/repos/kubernetes-configuration/test/crdsvalidation/common/testcase.go:178
                                                        /home/aldo/sdk/go1.24.4/src/runtime/asm_amd64.s:1700
                Error:          Received unexpected error:
                                KonnectGatewayControlPlane.konnect.konghq.com "test-jjtm2" is invalid: spec: Invalid value: "object": Name must be set for type Origin
    testcase.go:165: 
                Error Trace:    /home/aldo/repos/kubernetes-configuration/test/crdsvalidation/common/testcase.go:165
                Error:          Condition never satisfied
                Test:           TestKonnectGatewayControlPlane/updates_not_allowed_for_status_conditions/konnect.authRef_change_is_allowed_when_cp_is_not_Programmed=True_nor_APIAuthValid=True

=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane/updates_not_allowed_for_status_conditions (0.01s)

=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane/restriction_on_cluster_types/cluster_type_is_immutable_when_having_it_set_and_then_trying_to_unset_it (1.09s)
    testcase.go:165: 
                Error Trace:    /home/aldo/repos/kubernetes-configuration/test/crdsvalidation/common/testcase.go:175
                                                        /home/aldo/sdk/go1.24.4/src/runtime/asm_amd64.s:1700
                Error:          "KonnectGatewayControlPlane.konnect.konghq.com \"test-9rqb8\" is invalid: [<nil>: Invalid value: \"object\": no such key: status evaluating rule: spec.konnect.authRef is immutable when an entity is already Programmed, <nil>: Invalid value: \"object\": no such key: status evaluating rule: spec.konnect.authRef is immutable when an entity refers to a Valid API Auth Configuration]" does not contain "spec.cluster_type is immutable"
    testcase.go:165: 
                Error Trace:    /home/aldo/repos/kubernetes-configuration/test/crdsvalidation/common/testcase.go:165
                Error:          Condition never satisfied
                Test:           TestKonnectGatewayControlPlane/restriction_on_cluster_types/cluster_type_is_immutable_when_having_it_set_and_then_trying_to_unset_it

=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane/restriction_on_cluster_types (0.01s)

=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane (2.49s)

@alacuku alacuku force-pushed the kcl/konnect-konnectGatewayControlPlane-v1alpha2 branch 3 times, most recently from 33d0676 to c004108 Compare July 4, 2025 11:00
@alacuku
Copy link
Contributor Author

alacuku commented Jul 4, 2025

These test failures for KonnectGatewayControlPlane v1alpha1 are related to the CRD's storage version (v1alpha2) and the absence of a conversion method between versions:

=== Failed
=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane/updates_not_allowed_for_status_conditions/konnect.authRef_change_is_allowed_when_cp_is_not_Programmed=True_nor_APIAuthValid=True (1.10s)
    testcase.go:165: 
                Error Trace:    /home/aldo/repos/kubernetes-configuration/test/crdsvalidation/common/testcase.go:178
                                                        /home/aldo/sdk/go1.24.4/src/runtime/asm_amd64.s:1700
                Error:          Received unexpected error:
                                KonnectGatewayControlPlane.konnect.konghq.com "test-jjtm2" is invalid: spec: Invalid value: "object": Name must be set for type Origin
    testcase.go:165: 
                Error Trace:    /home/aldo/repos/kubernetes-configuration/test/crdsvalidation/common/testcase.go:165
                Error:          Condition never satisfied
                Test:           TestKonnectGatewayControlPlane/updates_not_allowed_for_status_conditions/konnect.authRef_change_is_allowed_when_cp_is_not_Programmed=True_nor_APIAuthValid=True

=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane/updates_not_allowed_for_status_conditions (0.01s)

=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane/restriction_on_cluster_types/cluster_type_is_immutable_when_having_it_set_and_then_trying_to_unset_it (1.09s)
    testcase.go:165: 
                Error Trace:    /home/aldo/repos/kubernetes-configuration/test/crdsvalidation/common/testcase.go:175
                                                        /home/aldo/sdk/go1.24.4/src/runtime/asm_amd64.s:1700
                Error:          "KonnectGatewayControlPlane.konnect.konghq.com \"test-9rqb8\" is invalid: [<nil>: Invalid value: \"object\": no such key: status evaluating rule: spec.konnect.authRef is immutable when an entity is already Programmed, <nil>: Invalid value: \"object\": no such key: status evaluating rule: spec.konnect.authRef is immutable when an entity refers to a Valid API Auth Configuration]" does not contain "spec.cluster_type is immutable"
    testcase.go:165: 
                Error Trace:    /home/aldo/repos/kubernetes-configuration/test/crdsvalidation/common/testcase.go:165
                Error:          Condition never satisfied
                Test:           TestKonnectGatewayControlPlane/restriction_on_cluster_types/cluster_type_is_immutable_when_having_it_set_and_then_trying_to_unset_it

=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane/restriction_on_cluster_types (0.01s)

=== FAIL: test/crdsvalidation/konnect.konghq.com TestKonnectGatewayControlPlane (2.49s)

Skipping failing test in: c004108

@alacuku alacuku marked this pull request as ready for review July 4, 2025 11:05
@alacuku alacuku requested a review from a team as a code owner July 4, 2025 11:05
Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

2 points I think we need to cover:

  • let's update the sample manifests in this repo with a note stating that this (v1alpha) API is deprecated and it shouldn't be used
  • let's make sure that we update the sample manifests in KGO when we change the controller logic to account for the new version

@alacuku
Copy link
Contributor Author

alacuku commented Jul 7, 2025

  • let's make sure that we update the sample manifests in KGO when we change the controller logic to account for the new version

I'm already working on updating the controller logic and use the new API version. I would block this PR until I have the changes in place in the controller logic.

WDYT?

@pmalek
Copy link
Member

pmalek commented Jul 7, 2025

  • let's make sure that we update the sample manifests in KGO when we change the controller logic to account for the new version

I'm already working on updating the controller logic and use the new API version. I would block this PR until I have the changes in place in the controller logic.

WDYT?

Sounds good.

This is a broader problem that I think we should tackle (get an agreed approach on), namely:

  • dev A makes breaking changes in kcfg and merges them (result commit C1)
  • he moves on to work on controller changes for this API change
  • dev B makes changes (breaking or not) in kcfg and merges them (result commit C2)
  • now dev B needs to wait for dev to update the kcfg dependency to C1 (or newer)

@alacuku alacuku force-pushed the kcl/konnect-konnectGatewayControlPlane-v1alpha2 branch from 7a25cce to 9ffddfb Compare July 8, 2025 07:43
@alacuku alacuku force-pushed the kcl/konnect-konnectGatewayControlPlane-v1alpha2 branch from 9ffddfb to c395eca Compare July 9, 2025 09:21
@alacuku alacuku requested a review from pmalek July 9, 2025 09:39
@alacuku alacuku force-pushed the kcl/konnect-konnectGatewayControlPlane-v1alpha2 branch 7 times, most recently from 4e1b5dc to 48dbfee Compare July 15, 2025 09:01
@mlavacca mlavacca self-assigned this Jul 15, 2025
mlavacca
mlavacca previously approved these changes Jul 15, 2025
Copy link
Member

@mlavacca mlavacca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@programmer04 programmer04 enabled auto-merge July 15, 2025 12:45
@programmer04 programmer04 removed the request for review from pmalek July 16, 2025 07:02
@programmer04 programmer04 disabled auto-merge July 16, 2025 07:03
@alacuku alacuku force-pushed the kcl/konnect-konnectGatewayControlPlane-v1alpha2 branch from 996da7f to 1868c10 Compare July 21, 2025 08:15
…ewayControlPlane

 `KonnectGatewayControlPlane` `v1alpha2` has been introduced.
  The `CreateControlPlaneRequest` fields (`name`, `description`, `clusterType`, `authType`, `cloudGateway`, `proxyUrls`, `labels`) have been moved from the top level of `spec` into a new structured field: `spec.createControlPlaneRequest`.
  **Action required:**
  - Update any manifests or code that reference these fields to use the new nested structure, e.g.:
    ```yaml
    spec:
      createControlPlaneRequest:
        name: my-control-plane
        clusterType: CLUSTER_TYPE_CONTROL_PLANE
        # ...other fields...
    ```
  - The old flat field layout is no longer supported in `v1alpha2`.

Signed-off-by: Aldo Lacuku <[email protected]>
@alacuku alacuku force-pushed the kcl/konnect-konnectGatewayControlPlane-v1alpha2 branch from 1868c10 to 4dba134 Compare July 21, 2025 10:47
@alacuku alacuku requested a review from pmalek July 22, 2025 08:37
@alacuku alacuku added this pull request to the merge queue Jul 22, 2025
Merged via the queue into main with commit c188bac Jul 22, 2025
25 checks passed
@alacuku alacuku deleted the kcl/konnect-konnectGatewayControlPlane-v1alpha2 branch July 22, 2025 10:35
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