Skip to content
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

Fix: Add MembersReferenceResolved condition for cp groups #824

Merged
merged 4 commits into from
Oct 30, 2024

Conversation

randmonkey
Copy link
Contributor

What this PR does / why we need it:
Add a MembersReferenceResolved condition in status of control plane groups.
Which issue this PR fixes

Fixes #797

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

@randmonkey randmonkey requested a review from a team as a code owner October 29, 2024 08:07
@randmonkey randmonkey added this to the KGO v1.4.x milestone Oct 29, 2024
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.

controller/konnect/ops/ops_controlplane.go Outdated Show resolved Hide resolved
controller/konnect/ops/ops_controlplane.go Outdated Show resolved Hide resolved
@randmonkey
Copy link
Contributor Author

Can we please cover this with a test? Perhaps we can extend the test cases in https://github.com/Kong/gateway-operator/blob/5d0b4b78c138f606b1eb5116e2649f35cf780bdb/test/envtest/konnect_entities_gatewaycontrolplane_test.go

Added unit tests.

@randmonkey randmonkey requested a review from pmalek October 29, 2024 09:31
@randmonkey randmonkey force-pushed the fix/add_member_status_in_cp_group branch from 7fdd5fd to b7c6345 Compare October 29, 2024 09:42
@pmalek pmalek force-pushed the fix/add_member_status_in_cp_group branch from b7c6345 to c74eabe Compare October 29, 2024 11:24
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.

I'm doing some testing on this one and I do not see the condition set consistently. Let's put this on pause until that's resolved.

@pmalek pmalek force-pushed the fix/add_member_status_in_cp_group branch from c74eabe to d575d40 Compare October 29, 2024 12:22
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.

This PR is missing setting the condition when we encounter a conflict against the API. Specifically when we hit

id, err = getControlPlaneForUID(ctx, sdk.GetControlPlaneSDK(), ent)
we have to handle the members there as well (or requeue for update which will handle that, but that's only going to happen when the sync period passes).

@randmonkey randmonkey force-pushed the fix/add_member_status_in_cp_group branch from d575d40 to ed01d88 Compare October 30, 2024 07:26
@randmonkey
Copy link
Contributor Author

This PR is missing setting the condition when we encounter a conflict against the API. Specifically when we hit

id, err = getControlPlaneForUID(ctx, sdk.GetControlPlaneSDK(), ent)

we have to handle the members there as well (or requeue for update which will handle that, but that's only going to happen when the sync period passes).

Added setGroupMembers in getControlPlaneForUID.

@randmonkey randmonkey requested a review from pmalek October 30, 2024 07:35
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.

Please resolve conflicts that arose since last review.

Overall this looks good. Just 1 nit about adding a test case for this.

controller/konnect/ops/ops_controlplane.go Show resolved Hide resolved
@randmonkey randmonkey force-pushed the fix/add_member_status_in_cp_group branch from ed01d88 to fe39896 Compare October 30, 2024 09:41
@randmonkey randmonkey requested a review from pmalek October 30, 2024 10:38
@pmalek pmalek force-pushed the fix/add_member_status_in_cp_group branch from 8eac34e to 7c524b0 Compare October 30, 2024 11:50
@pmalek pmalek enabled auto-merge (squash) October 30, 2024 11:50
@pmalek pmalek merged commit 8452e4a into main Oct 30, 2024
20 of 21 checks passed
@pmalek pmalek deleted the fix/add_member_status_in_cp_group branch October 30, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KonnectGatewayControlPlane have no status for CP group members references
2 participants