-
Notifications
You must be signed in to change notification settings - Fork 550
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
feat: migrate elasticquota controller to ctrl runtime #527
feat: migrate elasticquota controller to ctrl runtime #527
Conversation
Hi @czybjtu. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
/assign @zwpaper |
@Huang-Wei: GitHub didn't allow me to assign the following users: zwpaper. Note that only kubernetes-sigs members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
cc @zwpaper PTAL |
hi @czybjtu, sorry for the later response, I will look into this PR in the following days. btw, scheduler-plugins is cutting off for the 0.25.x release, the WIP migrations of ctl-runtime will be planned to the next releases. |
Got it. Thanks for your reminding. |
/assign |
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.
hi @czybjtu, please revert the unnecessary indentation changes in yaml files, and added some other comments
if err := r.List(ctx, podList, client.InNamespace(namespace)); err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, p := range podList.Items { | ||
if p.Status.Phase == v1.PodRunning { | ||
used = quota.Add(used, computePodResourceRequest(&p)) | ||
} | ||
} |
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.
how about using a field selector
/milestone v1.26 |
cd54d9d
to
2f5cf9b
Compare
/test pull-scheduler-plugins-integration-test-master |
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.
hi @czybjtu, I have one more question, add review
2f5cf9b
to
1cce271
Compare
/test pull-scheduler-plugins-integration-test-master |
/lgtm please have a look at this PR when you have some cycle @Huang-Wei @denkensk /assign @Huang-Wei @denkensk |
1cce271
to
af59d2e
Compare
/lgtm |
/cc |
af59d2e
to
7861560
Compare
PR rebased. |
podMetaType := &metav1.PartialObjectMetadata{} | ||
podMetaType.SetGroupVersionKind(schema.GroupVersionKind{Kind: "Pod", Group: "", Version: "v1"}) | ||
return ctrl.NewControllerManagedBy(mgr). | ||
Watches(&source.Kind{Type: podMetaType}, &handler.EnqueueRequestForObject{}). |
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.
Is the usage of PartialObjectMetadata intentional? otherwise, this can achieve the same goal:
podMetaType := &metav1.PartialObjectMetadata{} | |
podMetaType.SetGroupVersionKind(schema.GroupVersionKind{Kind: "Pod", Group: "", Version: "v1"}) | |
return ctrl.NewControllerManagedBy(mgr). | |
Watches(&source.Kind{Type: podMetaType}, &handler.EnqueueRequestForObject{}). | |
return ctrl.NewControllerManagedBy(mgr). | |
Watches(&source.Kind{Type: &v1.Pod{}}, &handler.EnqueueRequestForObject{}). |
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.
Both ways are OK. Adopt your suggestion to keep consistency with podgroup controller.
7861560
to
c5f2698
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.
/approve
(leave lgtm to other reviewers)
Thanks @czybjtu!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: czybjtu, Huang-Wei 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 |
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
#485
Special notes for your reviewer:
Does this PR introduce a user-facing change?