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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yangshiqi
Copy link
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 <[email protected]>
Copy link

codecov bot commented Mar 13, 2025

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 64.91% <85.41%> (+17.93%) ⬆️

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 10 files with indirect coverage changes

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

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.

1 participant