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

Find one scalable pattern to wrap clients, and deprecate others #2888

Open
dlipovetsky opened this issue Jul 24, 2024 · 4 comments
Open

Find one scalable pattern to wrap clients, and deprecate others #2888

dlipovetsky opened this issue Jul 24, 2024 · 4 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@dlipovetsky
Copy link
Contributor

As @sbueringer observed in #2860 (comment),
we have, as of now, at least four different ways to wrap the client:

  • intercept.NewClient
  • NewDryRunClient
  • WithFieldOwner
  • WithStrictFieldValidation

... I think we should find a more scalable pattern to wrap clients.
If we continue to introduce a new wrapper for every single option we will end up with a lot of wrappers.

If we continue to introduce a new wrapper for every single option we will end up with a lot of wrappers.

I guess the same way we could either:

  • only have one wrapper taking various options and acting accordingly
    • This also makes the options more discoverable for users
    • Pretty sure we end up with more consistency then (see the list of wrappers below)
  • add options to the main client (that's probalby not good because then they cannot be used with the fake client)

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 24, 2024
@alvaroaleman
Copy link
Member

When building this we should also try to solve: #2967
All the wrappers we have don't properly deal with client.WithWatch and end up removing the Watch functionality.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 28, 2024
@sbueringer
Copy link
Member

/remove-lifecycle stale

/help

@k8s-ci-robot
Copy link
Contributor

@sbueringer:
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:

/remove-lifecycle stale

/help

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 help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

5 participants