Skip to content

Separate options from client to make the responsibility more clear.#938

Merged
archlitchi merged 5 commits into
Project-HAMi:masterfrom
yangshiqi:options
May 12, 2025
Merged

Separate options from client to make the responsibility more clear.#938
archlitchi merged 5 commits into
Project-HAMi:masterfrom
yangshiqi:options

Conversation

@yangshiqi

Copy link
Copy Markdown
Contributor

Remove the magic number in the main function and define it as a constant.

What type of PR is this?

/kind feature

What this PR does / why we need it:
add kubeclient timeout parameter.
In our scenarios, biz logic needs to be coordinated with multi-node scheduling. When the nodes' number is large, the kube API's timeout must be controlled to prevent it from being stuck.

Which issue(s) this PR fixes:
Fixes # nope

Special notes for your reviewer:
Depends on PR #681
Base on this pr, I merged my version and splited the params according to the option feature of k8s, to separate the options-related extensions(maybe more like request/transports) from the client. I also isolated the default params in client, to prepare for the future needs of hami, and avoided the magic numbers.

Does this PR introduce a user-facing change?:
nope

Remove the magic number in the main function and define it as a constant.

Signed-off-by: yangshiqi <yangshiqi@riseunion.io>
@codecov

codecov Bot commented Mar 13, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 85.41667% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/util/client/client.go 72.00% 5 Missing and 2 partials ⚠️
Flag Coverage Δ
unittests 65.73% <85.41%> (+18.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/util/client/options.go 100.00% <100.00%> (ø)
pkg/util/client/client.go 68.29% <72.00%> (+14.12%) ⬆️

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ouyangluwei163

Copy link
Copy Markdown
Contributor
image

Burst/QPS 未生效

remove some comments to try e2e

Signed-off-by: yangshiqi <yangshiqi@riseunion.io>
Signed-off-by: yangshiqi <yangshiqi@riseunion.io>
Signed-off-by: yangshiqi <yangshiqi@riseunion.io>
@archlitchi

Copy link
Copy Markdown
Member

/lgtm

@archlitchi archlitchi merged commit de20781 into Project-HAMi:master May 12, 2025
13 checks passed
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.

3 participants