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

Scheduler service_affinity_test.go should use a fake SharedInformerFactory and call New #84943

Open
liu-cong opened this issue Nov 7, 2019 · 2 comments
Assignees

Comments

@liu-cong
Copy link
Contributor

@liu-cong liu-cong commented Nov 7, 2019

What would you like to be added:
The test should call service_affinity.New directly instead of creating predicates and priorities. This requires a fake SharedInformerFactory to be used as an option for the framework. The fake SharedInformerFactory should return a fake service lister that returns the services in test.

There might be other cases like this too. We should fix them.

predicate, precompute := predicates.NewServiceAffinityPredicate(snapshot.NodeInfos(), snapshot.Pods(), fakelisters.ServiceLister(test.services), test.labels)

Why is this needed:
The initialization code path is not properly tested without this.

/sig scheduling

@ahg-g

This comment has been minimized.

Copy link
Member

@ahg-g ahg-g commented Nov 8, 2019

/help

@mrkm4ntr

This comment has been minimized.

Copy link
Member

@mrkm4ntr mrkm4ntr commented Nov 8, 2019

/assign
/remove-help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.