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

enable getPreferredAllocation #538

Merged
merged 1 commit into from
Jan 6, 2021
Merged

enable getPreferredAllocation #538

merged 1 commit into from
Jan 6, 2021

Conversation

uniemimu
Copy link
Contributor

@uniemimu uniemimu commented Jan 4, 2021

The option was left to false, this fixes it.

Signed-off-by: Ukri Niemimuukko ukri.niemimuukko@intel.com

@codecov-io
Copy link

codecov-io commented Jan 4, 2021

Codecov Report

Merging #538 (13b33d7) into master (11387c2) will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #538      +/-   ##
==========================================
+ Coverage   57.12%   57.24%   +0.12%     
==========================================
  Files          31       31              
  Lines        2120     2119       -1     
==========================================
+ Hits         1211     1213       +2     
+ Misses        839      837       -2     
+ Partials       70       69       -1     
Impacted Files Coverage Δ
pkg/deviceplugin/server.go 86.42% <100.00%> (+2.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11387c2...13b33d7. Read the comment docs.

Comment on lines 82 to 85
return &pluginapi.DevicePluginOptions{
PreStartRequired: srv.preStartContainer != nil,
GetPreferredAllocationAvailable: false,
GetPreferredAllocationAvailable: srv.getPreferredAllocation != nil,
}, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather put this struct creation into a private method with narrow interface like func (srv *server) getDevicePluginOptions() *pluginapi.DevicePluginOptions and use it here and also inside registerWithKublet().
This way we wouldn't need to create and immediately throw away the context.

Then we can drop options from registerWithKublet()'s signature.

The option was left to false, this fixes it.

Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
@bart0sh bart0sh merged commit f80f498 into intel:master Jan 6, 2021
@uniemimu uniemimu deleted the preferred branch January 7, 2021 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants