csharp icon indicating copy to clipboard operation
csharp copied to clipboard

Enhance AbstractKubernetes SendRequest extensibility

Open wimoy opened this issue 3 years ago • 5 comments

We want to use a Polly to handle retries in the KubernetesClient send request code path. HttpRequestMessage and HttpContent objects can only be passed in once to an HttpClient.SendAsync call. On each retry, a new HttpRequestMessage needs to be constructed; the previous HttpRequestMessage cannot be reused. We want the send request extensibility point in KubernetesClient to provide the underlying data used to construct the HttpRequestMessage instead of providing the HttpRequestMessage itself.

This PR generalizes the existing send request extensibility without making the contract more complicated.

wimoy avatar Sep 03 '22 10:09 wimoy

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: wimoy / name: William Moy (79bf45c489a93f8014efa64563d78d88416b9fcb)

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wimoy Once this PR has been reviewed and has the lgtm label, please assign tg123 for approval by writing /assign @tg123 in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Sep 03 '22 10:09 k8s-ci-robot

Welcome @wimoy!

It looks like this is your first PR to kubernetes-client/csharp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-client/csharp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Sep 03 '22 10:09 k8s-ci-robot

/LGTM

tg123 avatar Sep 03 '22 10:09 tg123

btw could you please add an example or document how to mock/test Kubernetes client?

better to illustrate why the change is needed and help others in similar situations

tg123 avatar Sep 03 '22 20:09 tg123

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

This bot triages issues and PRs 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 or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

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

/lifecycle stale

k8s-triage-robot avatar Dec 03 '22 08:12 k8s-triage-robot

/approve

Sorry I missed this PR...

brendandburns avatar Dec 05 '22 16:12 brendandburns

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, wimoy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Dec 05 '22 16:12 k8s-ci-robot