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

Support GroupMembers API Pagination for Client #5533

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

qiyueyao
Copy link
Contributor

@qiyueyao qiyueyao commented Sep 28, 2023

GroupMembers API was introduced in #5380 , pagination was supported for proxy server, but not for client. There are usecases for client-go pagination. This solution utilizes the GroupMembersExpansion to provide a new method GetPaginated.

@qiyueyao qiyueyao changed the title Support Group API Pagination for Client Support GroupMembers API Pagination for Client Sep 28, 2023
Copy link
Contributor

@Dyanngg Dyanngg left a comment

Choose a reason for hiding this comment

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

Should we extend this to ClusterGroupMemberExpansion as well?

// IP is the IP address of the Endpoints associated with the GroupMember.
IPs []IPAddress
// Ports is the list NamedPort of the GroupMember.
Ports []NamedPort
// Node maintains the reference to the Node.
Copy link
Contributor

Choose a reason for hiding this comment

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

change not related to the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it not related, just found the order was not consistent with type in v1beta2.

@qiyueyao qiyueyao requested review from Dyanngg and tnqn October 3, 2023 22:02
Dyanngg
Dyanngg previously approved these changes Oct 4, 2023
Copy link
Contributor

@Dyanngg Dyanngg left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM overall


func convertToV1beta2Members(members []controlplane.GroupMember) []v1beta2.GroupMember {
var result []v1beta2.GroupMember
for _, item := range members {
Copy link
Member

Choose a reason for hiding this comment

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

Can we use Schema.Convert to do the conversion for code reuse?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to conversion function in v1beta2.


func convertToControlplaneMembers(members []v1beta2.GroupMember) []controlplane.GroupMember {
var result []controlplane.GroupMember
for _, item := range members {
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@@ -489,17 +489,7 @@ func RegisterConversions(s *runtime.Scheme) error {

func autoConvert_v1beta2_AddressGroup_To_controlplane_AddressGroup(in *AddressGroup, out *controlplane.AddressGroup, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if in.GroupMembers != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Is this caused by the move of Node *NodeReference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so, it's generated code, surprised to see this shortened conversion.

Follow up for Group membership API to provide paginated
Get function for client.

Signed-off-by: Qiyue Yao <yaoq@vmware.com>
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@tnqn
Copy link
Member

tnqn commented Oct 12, 2023

/test-all

@tnqn tnqn merged commit de7493b into antrea-io:main Oct 12, 2023
@qiyueyao qiyueyao deleted the group-api-client branch October 12, 2023 17:29
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