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

Add clientset for ClusterGroupMembers and GroupAssociation #2130

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

Dyanngg
Copy link
Contributor

@Dyanngg Dyanngg commented Apr 27, 2021

Enhance programmatic access to the ClusterGroupMembers and GroupAssociation resources.
Both can now be accessed via the Antrea clientset

antreaClient.ControlplaneV1beta2().ClusterGroupMemberses().Get(xxxx)
antreaClient.ControlplaneV1beta2().GroupAssociations(namespace).Get(xxxx)

Note that the interface for ClusterGroupMembers is awkwardly named: this is because in controlplane/v1beta2/types.go the resource itself is defined in its plural form, which is out of the convention for client generation. In future controlplane API group upgrade, we should consider updating the ClusterGroupMembers type to ClusterGroupMember.

antoninbas
antoninbas previously approved these changes Apr 27, 2021
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

This looks good on my side.
Yes we should probably rename it to ClusterGroupMembership in the future to match GroupAssociation

@codecov-commenter
Copy link

codecov-commenter commented Apr 27, 2021

Codecov Report

Merging #2130 (4f59a5a) into main (eadf092) will increase coverage by 4.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2130      +/-   ##
==========================================
+ Coverage   61.26%   65.28%   +4.02%     
==========================================
  Files         269      269              
  Lines       20424    20791     +367     
==========================================
+ Hits        12512    13574    +1062     
+ Misses       6624     5831     -793     
- Partials     1288     1386      +98     
Flag Coverage Δ
e2e-tests 56.41% <ø> (?)
kind-e2e-tests 52.14% <ø> (+0.04%) ⬆️
unit-tests 41.41% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...gent/controller/networkpolicy/status_controller.go 72.60% <0.00%> (-2.74%) ⬇️
...ntroller/networkpolicy/networkpolicy_controller.go 69.35% <0.00%> (-0.97%) ⬇️
pkg/controller/networkpolicy/status_controller.go 86.45% <0.00%> (-0.65%) ⬇️
pkg/agent/openflow/network_policy.go 76.41% <0.00%> (+0.59%) ⬆️
pkg/agent/cniserver/pod_configuration.go 54.68% <0.00%> (+0.78%) ⬆️
pkg/ovs/openflow/ofctrl_bridge.go 51.10% <0.00%> (+1.10%) ⬆️
pkg/controller/egress/store/egressgroup.go 1.38% <0.00%> (+1.38%) ⬆️
pkg/apiserver/apiserver.go 91.05% <0.00%> (+1.62%) ⬆️
pkg/ovs/openflow/ofctrl_flow.go 47.36% <0.00%> (+1.75%) ⬆️
pkg/agent/flowexporter/exporter/exporter.go 77.55% <0.00%> (+2.31%) ⬆️
... and 42 more

// ClusterGroupMembersesGetter has a method to return a ClusterGroupMembersInterface.
// A group's client should implement this interface.
type ClusterGroupMembersesGetter interface {
ClusterGroupMemberses() ClusterGroupMembersInterface
Copy link
Member

Choose a reason for hiding this comment

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

You can specify "--plural-exceptions" when calling client-gen to avoid it

Copy link
Contributor Author

@Dyanngg Dyanngg Apr 28, 2021

Choose a reason for hiding this comment

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

Thanks for coming to the rescue, as always :) Updated

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, thanks.

@Dyanngg
Copy link
Contributor Author

Dyanngg commented Apr 28, 2021

/test-all

@Dyanngg
Copy link
Contributor Author

Dyanngg commented Apr 29, 2021

/test-networkpolicy

@tnqn tnqn merged commit 7052cb8 into antrea-io:main Apr 29, 2021
@Dyanngg Dyanngg deleted the cg-member-assoc-clientset branch November 3, 2021 00:52
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.

5 participants