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

Replace args with struct for grpc registration. #4372

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

absoludity
Copy link
Contributor

@absoludity absoludity commented Mar 2, 2022

Signed-off-by: Michael Nelson minelson@vmware.com

Description of the change

This is a prequel to #4370 . It doesn't make any functional change, but just pulls out the arguments to the dynamically loaded grpc registration function into a struct defined in the one place. This makes it easier moving forward for us to modify it when needed in the one place. Please see #4370 for an example where we ensure plugins have access to QPS and Burst options without having to change other plugins necessarily.

Benefits

Easier to modify grpc registration args in the future.

Possible drawbacks

Applicable issues

Additional information

I again hit an import naming issue here, because some plugins import both the generated plugins/v1alpha1 as well as our implementation module for plugins/v1alpha1. So @antgamdia , I looked up your earlier #4176 where you'd put some thought into this and found in the list there, where I think you found options for this same situation:

pluginsgrpcv1alpha1 "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen/core/plugins/v1alpha1"
pluginsgrpcv1alpha1 "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen/plugins/fluxv2/packages/v1alpha1"
pluginsv1alpha1 "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/core/plugins/v1alpha1"
pluginsv1alpha1 "github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen/core/plugins/v1alpha1"

Now I assume the last entry there is incorrect (probably before you'd realised that some modules import both) as it duplicates the alias of the 3rd and the import path of the first. Similarly, I think the 2nd is misnamed (it's a flux plugin), and so I have used here the examples from the 1st and 3rd entries in the above snippet for the generated module and our implementation module.

Let me know if that's not what you intended.

Signed-off-by: Michael Nelson <minelson@vmware.com>
absoludity added a commit to absoludity/kubeapps that referenced this pull request Mar 2, 2022
Signed-off-by: Michael Nelson <minelson@vmware.com>
Copy link
Contributor

@antgamdia antgamdia left a comment

Choose a reason for hiding this comment

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

Great, I'm a big fan of the struct args, otherwise adding new params is always a mess. Thanks for the change!

@absoludity absoludity merged commit 056926d into main Mar 7, 2022
@absoludity absoludity deleted the 4329-update-registration-signature branch March 7, 2022 01:48
absoludity added a commit to absoludity/kubeapps that referenced this pull request Mar 7, 2022
Signed-off-by: Michael Nelson <minelson@vmware.com>
absoludity added a commit that referenced this pull request Mar 7, 2022
* Ensure that the discovery client has sufficient QPS/Burst.

Signed-off-by: Michael Nelson <minelson@vmware.com>

* Use constants for discovery client qps/burst

Signed-off-by: Michael Nelson <minelson@vmware.com>

* Update to use new opts struct from #4372

Signed-off-by: Michael Nelson <minelson@vmware.com>
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.

2 participants