-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Support ExtenderName in FakeExtender #108230
Conversation
@sanposhiho: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
/sig scheduling |
/retest |
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-contributor-experience at kubernetes/community. /check-cla |
pkg/scheduler/extender_test.go
Outdated
@@ -58,10 +58,12 @@ func TestGenericSchedulerWithExtenders(t *testing.T) { | |||
}, | |||
extenders: []st.FakeExtender{ | |||
{ | |||
Predicates: []st.FitPredicate{st.TruePredicateExtender}, | |||
ExtenderName: "FakeExtenderName1", |
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.
FakeExtender1 is more concise.
@@ -155,9 +158,15 @@ type FakeExtender struct { | |||
CachedNodeNameToInfo map[string]*framework.NodeInfo | |||
} | |||
|
|||
const defaultExtenderName = "FakeExtender" |
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.
const defaultFakeExtenderName = "defaultFakeExtender" ?
pkg/scheduler/extender_test.go
Outdated
@@ -134,6 +142,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) { | |||
}, | |||
extenders: []st.FakeExtender{ | |||
{ | |||
ExtenderName: "FakeExtenderName1", |
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.
if we have default ExtenderName, do we need this?
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.
Of course, it will work without it, but I think it's better to have it.
(For example, if someone wants to add new test case with reference to existing test cases, he/she can notice that it (may) need ExtenderName.)
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
Will leave LGTM to already involved reviewers.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, sanposhiho 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 |
Great, leave LGTM to @denkensk and don't forget to squash the commits. Thanks @sanposhiho |
e2fc696
to
5f4a4ec
Compare
5f4a4ec
to
0b16a7f
Compare
/lgtm |
/retest |
What type of PR is this?
/kind feature
What this PR does / why we need it:
The name of Extender should be unique. There is no way to specify FakeExtender's name and all FakeExtender's name is "FakeExtender". This PR supports ExtenderName in FakeExtender to allow to specify FakeExtender's name.
Currently, There are no issue with this because in k/k no one is using
Name()
func on Extender.But, #107984 adds top 3 score of node in event message and will use
Name()
method on Extender to get Extender's name for event messages. Therefore, #107984 needs the way to specify FakeExtender's name for unit tests.(I implemented this feature in #107984, but #107984 is big and difficult to review because of that. Therefore, I'm considering splitting #107984 into multiple PRs. This PR is one of them.)
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: