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

refact: move functions from mgr to container #2746

Closed
wants to merge 1 commit into from

Conversation

allencloud
Copy link
Collaborator

@allencloud allencloud commented Mar 13, 2019

Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com

Ⅰ. Describe what this PR did

Actuallyfunc (mgr *ContainerManager) updateContainerResources(c *Container, resources types.Resources) error { has nothing to do with ContainerManager. And it is only a inner function of container. Then move this function to a better location.

In addition, log related functions have the same issue:

  • SetLogPath
  • logOptionsForContainerio
  • convToLoggerInfo
  • SetLogPath

Ⅱ. Does this pull request fix one issue?

none, just refactor.

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

no need

Ⅳ. Describe how to verify it

none

Ⅴ. Special notes for reviews

none

@codecov
Copy link

codecov bot commented Mar 13, 2019

Codecov Report

Merging #2746 into master will increase coverage by 0.03%.
The diff coverage is 67.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2746      +/-   ##
==========================================
+ Coverage   69.32%   69.35%   +0.03%     
==========================================
  Files         278      277       -1     
  Lines       17448    17451       +3     
==========================================
+ Hits        12096    12104       +8     
+ Misses       4025     4023       -2     
+ Partials     1327     1324       -3
Flag Coverage Δ
#criv1alpha2_test 39.5% <58.9%> (+0.03%) ⬆️
#integration_test_0 36.6% <61.64%> (+0.01%) ⬆️
#integration_test_1 35.51% <35.61%> (-0.02%) ⬇️
#integration_test_2 36.56% <35.61%> (ø) ⬆️
#integration_test_3 35.39% <41.09%> (-0.02%) ⬇️
#node_e2e_test 35.43% <35.61%> (+0.13%) ⬆️
#unittest 28.43% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
daemon/mgr/container_validation.go 43.19% <100%> (+0.26%) ⬆️
daemon/mgr/container_types.go 70.38% <65.15%> (-2.47%) ⬇️
daemon/mgr/container.go 61.47% <80%> (+0.51%) ⬆️
apis/server/utils.go 71.15% <0%> (-3.85%) ⬇️
daemon/mgr/events.go 89.04% <0%> (-2.74%) ⬇️
ctrd/client.go 64.04% <0%> (-1.69%) ⬇️
ctrd/container.go 57.36% <0%> (-0.39%) ⬇️
cri/v1alpha2/cri.go 71.88% <0%> (+0.64%) ⬆️
daemon/mgr/spec_linux.go 79.85% <0%> (+1.07%) ⬆️
... and 1 more

Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
@pouchrobot pouchrobot added size/XL and removed size/L labels Mar 13, 2019
@allencloud allencloud changed the title refact: move updateContainerResource to be part of container struct refact: move functions from mgr to container Mar 13, 2019
@fuweid
Copy link
Contributor

fuweid commented Oct 14, 2019

@allencloud I am going to close it since it is not active right now. Please feel free to reopen it. Thanks

@fuweid fuweid closed this Oct 14, 2019
@pouchrobot
Copy link
Collaborator

ping @allencloud
Conflict happens after merging a previous commit.
Please rebase the branch against master and push it back again. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants