-
Notifications
You must be signed in to change notification settings - Fork 233
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
fix: scheduler ignore KUBECONFIG env even if this environment variable is set #681
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ae54f90
to
dda05c5
Compare
57fee3a
to
4aae789
Compare
pkg/scheduler/scheduler.go
Outdated
@@ -125,7 +126,7 @@ func (s *Scheduler) onDelPod(obj interface{}) { | |||
} | |||
|
|||
func (s *Scheduler) Start() { | |||
kubeClient, err := k8sutil.NewClient() | |||
kubeClient, err := client.NewClient() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use client.GetClient()
to get kubeClient, because this kubeClient having init function Initialization completed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. By doing so, some the unused code can also be removed
suggest title: fix: scheduler ignore KUBECONFIG env even if this environment variable is set |
7e05044
to
2637cf5
Compare
@Shouren can you rebase main branch? because having resolve code lint question. |
…il/client in pkg/scheduler/scheduler.go Signed-off-by: Shouren Yang <[email protected]>
2637cf5
to
09448b9
Compare
@lengrongfu All right, rebase is done. |
/lgtm |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The implementation of
NewClient
function inpkg/k8sutil/client.go
gets*restclient.Config
fromInClusterConfig
api first even if theKUBECONFIG
env has been set which is out of expect. This PR fix it.Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?: