-
Notifications
You must be signed in to change notification settings - Fork 545
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
migrate elasticquota/capacityscheduling to controller-runtime #665
migrate elasticquota/capacityscheduling to controller-runtime #665
Conversation
✅ Deploy Preview for kubernetes-sigs-scheduler-plugins canceled.
|
@zwpaper please take a look. |
0eb30b4
to
b6cb294
Compare
FilterFunc: func(obj interface{}) bool { | ||
switch t := obj.(type) { | ||
case *v1alpha1.ElasticQuota: | ||
dynamicCache, err := ctrlruntimecache.New(handle.KubeConfig(), ctrlruntimecache.Options{Scheme: scheme}) |
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.
Also cc @denkensk, this might need your second look, as I'm changing typed informer to controller-runtime's equivalent (I think ;)) utility. Please shed your light.
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.
look good to me.
The unit test failure is interesting:
This error occurred when hitting this (new) line: elasticQuotaInformer, err := dynamicCache.GetInformer(context.Background(), &v1alpha1.ElasticQuota{}) But why integreation test passed? It's b/c integration test fully spins up the CRD (ElasticQuota), while main_test.go doesn't. Unfortunately the (dynamic) GVK discovery in controller-runtime libs issue a http call to discover all API resources, but when we used typed client, it's not needed. |
4ee7493
to
c06e135
Compare
The 2nd commit fixed the issue. |
} else { | ||
c.client = client | ||
} |
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.
``
} else { | |
c.client = client | |
} | |
} | |
c.client = client |
pkg/util/client.go
Outdated
@@ -0,0 +1,28 @@ | |||
package util |
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.
+Copyright
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.
let me remove this file. It's not used now.
FilterFunc: func(obj interface{}) bool { | ||
switch t := obj.(type) { | ||
case *v1alpha1.ElasticQuota: | ||
dynamicCache, err := ctrlruntimecache.New(handle.KubeConfig(), ctrlruntimecache.Options{Scheme: scheme}) |
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.
look good to me.
c06e135
to
28e0736
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Huang-Wei, yibozhuang 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 |
What type of PR is this?
/kind feature
/kind cleanup
What this PR does / why we need it:
migrate elasticquota/capacityscheduling to controller-runtime
This is the last piece to complete #485.
Which issue(s) this PR fixes:
Part of #485
Special notes for your reviewer:
Now,
pkg/generated
is the only package that include generated type client bits:But, I'm not going to remove them. Instead, I will send out a notice and deprecation notice in the release notes (v0.27). So plugins that use this repo's typed clientset have buffer to make changes.
Does this PR introduce a user-facing change?