Skip to content

[Refactoring Suggestions] refactored Operator.register api in v2 #687

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

Closed
heesuk-ahn opened this issue Nov 17, 2021 · 2 comments
Closed

[Refactoring Suggestions] refactored Operator.register api in v2 #687

heesuk-ahn opened this issue Nov 17, 2021 · 2 comments

Comments

@heesuk-ahn
Copy link
Contributor

Motivation

Operator register api of v2 can remove the part that passes null as a parameter through method overloading.

In this case, we can remove the logic to protect null from the logic inside the register api.

This can make register api code more readable.

Proposal

  • Change deprecated kubernetesClient.getVersion to KubernetesClient.getKubernetesVersion
  • Pass a non-null value as a parameter by creating defaultConfiguration in register(Reconciler reconciler)
  • Remove unnecessary null defense code
@heesuk-ahn
Copy link
Contributor Author

I created a pull request to show an example. :)

#688

@heesuk-ahn heesuk-ahn changed the title [Refactoring Suggestions] refactored Operator.register api [Refactoring Suggestions] refactored Operator.register api in v2 Nov 17, 2021
@csviri
Copy link
Collaborator

csviri commented Nov 18, 2021

Makes sense to me , also PR looks good. Thank you!

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

No branches or pull requests

2 participants