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

Use generics for functions used in controller-runtime's builders #3150

Open
chrischdi opened this issue Aug 12, 2024 · 2 comments
Open

Use generics for functions used in controller-runtime's builders #3150

chrischdi opened this issue Aug 12, 2024 · 2 comments
Labels
area/govmomi Issues or PRs related to the govmomi mode area/supervisor Issues or PRs related to the supervisor mode help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@chrischdi
Copy link
Member

/kind cleanup
/help

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

When using the builder from cotnroller runtime (Setup functions for AddToManager) we should migrate to use generics.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Follow-up from
#3146 (comment)

Environment:

  • Cluster-api-provider-vsphere version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):
@k8s-ci-robot
Copy link
Contributor

@chrischdi:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/kind cleanup
/help

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

When using the builder from cotnroller runtime (Setup functions for AddToManager) we should migrate to use generics.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Follow-up from
#3146 (comment)

Environment:

  • Cluster-api-provider-vsphere version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Aug 12, 2024
@sbueringer
Copy link
Member

Note: It's enough to do this only in cases where we are actually using the types (vs. just using client.Object).

One example would be:

vsphereMachine, ok := o.(*vmwarev1.VSphereMachine)

Here we are actually using VSphereMachine, there are also cases where we just use client.Object, in these cases there would be no benefit to moving to generics

@sbueringer sbueringer added area/supervisor Issues or PRs related to the supervisor mode area/govmomi Issues or PRs related to the govmomi mode labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/govmomi Issues or PRs related to the govmomi mode area/supervisor Issues or PRs related to the supervisor mode help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

No branches or pull requests

3 participants