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

refactor: delete update specific code #2165

Merged

Conversation

HusterWan
Copy link
Contributor

Signed-off-by: Michael Wan zirenwan@gmail.com

Ⅰ. Describe what this PR did

updating container will also update a Label DiskQuota, this is not a common action that just is for compatible with situation in alibaba. so i will delete this part, and move the operation to PreUpate hook

Ⅱ. Does this pull request fix one issue?

none

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

yes

Ⅳ. Describe how to verify it

none

Ⅴ. Special notes for reviews

none

Signed-off-by: Michael Wan <zirenwan@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #2165 into master will increase coverage by 0.16%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2165      +/-   ##
==========================================
+ Coverage    64.3%   64.46%   +0.16%     
==========================================
  Files         209      209              
  Lines       16693    16690       -3     
==========================================
+ Hits        10735    10760      +25     
+ Misses       4618     4600      -18     
+ Partials     1340     1330      -10
Flag Coverage Δ
#criv1alpha1test 33% <0%> (+0.18%) ⬆️
#criv1alpha2test 33.6% <0%> (+0.19%) ⬆️
#integrationtest 39.32% <28.57%> (+0.01%) ⬆️
#unittest 24.02% <0%> (ø) ⬆️
Impacted Files Coverage Δ
daemon/mgr/container.go 56.77% <28.57%> (+0.78%) ⬆️
cri/v1alpha2/cri.go 64.01% <0%> (+0.33%) ⬆️
cri/v1alpha1/cri.go 63.36% <0%> (+0.34%) ⬆️
ctrd/container.go 43.19% <0%> (+1.43%) ⬆️
daemon/logger/jsonfile/utils.go 73.17% <0%> (+1.62%) ⬆️
daemon/mgr/system.go 79.33% <0%> (+1.65%) ⬆️
ctrd/watch.go 80.3% <0%> (+7.57%) ⬆️

@@ -1020,6 +1006,12 @@ func (mgr *ContainerManager) Update(ctx context.Context, name string, config *ty
}
c.Config.Env = newEnvSlice

if mgr.containerPlugin != nil {
if err = mgr.containerPlugin.PostUpdate(c.BaseFS, c.Config.Env); err != nil {
return err
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have a rule to record the error log in the caller's code or the implementation part? @HusterWan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we will record the error log in the end of api.

@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Aug 27, 2018
@allencloud allencloud merged commit 13d2766 into AliyunContainerService:master Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/test kind/refactor LGTM one maintainer or community participant agrees to merge the pull reuqest. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants