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: move functions from pre-start hook to pouchd #2064

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

rudyfly
Copy link
Collaborator

@rudyfly rudyfly commented Aug 7, 2018

Ⅰ. Describe what this PR did

move the functions: set rootfs quota and set mtab from pre-start
hook in runc to pouchd container's create. Pouchd mounts the rootfs and
do these functions, if it is successful, and then umount the rootfs.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: Rudy Zhang rudyflyzhang@gmail.com

@codecov-io
Copy link

codecov-io commented Aug 7, 2018

Codecov Report

Merging #2064 into master will decrease coverage by 0.01%.
The diff coverage is 48.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2064      +/-   ##
==========================================
- Coverage   63.86%   63.84%   -0.02%     
==========================================
  Files         205      206       +1     
  Lines       15759    15762       +3     
==========================================
- Hits        10064    10063       -1     
- Misses       4441     4444       +3     
- Partials     1254     1255       +1
Flag Coverage Δ
#criv1alpha1test 33.18% <27.68%> (-0.05%) ⬇️
#criv1alpha2test 33.85% <27.68%> (-0.03%) ⬇️
#integrationtest 37.88% <48.37%> (+0.06%) ⬆️
#unittest 23.6% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
daemon/mgr/spec_hook.go 23.8% <ø> (-16.82%) ⬇️
daemon/mgr/container_types.go 81.39% <ø> (ø) ⬆️
storage/quota/quota.go 17.96% <ø> (ø) ⬆️
pkg/system/device.go 60% <0%> (-40%) ⬇️
storage/quota/grpquota.go 0% <0%> (ø) ⬆️
daemon/mgr/container.go 55.52% <33.33%> (+1.78%) ⬆️
daemon/mgr/container_storage.go 49.48% <49.48%> (ø)
ctrd/image.go 78.81% <0%> (-0.5%) ⬇️
cri/v1alpha2/cri.go 66.02% <0%> (-0.18%) ⬇️
... and 2 more

@@ -2224,6 +2236,104 @@ func (mgr *ContainerManager) populateVolumes(ctx context.Context, c *Container)
return nil
}

func (mgr *ContainerManager) setMountTab(ctx context.Context, c *Container) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

mgr/container.go are too big, some functions are worked for container object, maybe we can put the code into container_type.go, WDYT???

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I add a new file container_storage.go to manager the operation of container storage module.

move the functions: `set rootfs quota` and `set mtab` from pre-start
hook in runc to pouchd container's create. Pouchd mounts the rootfs and
do these functions, if it is successful, and then umount the rootfs.

Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
@Ace-Tang
Copy link
Contributor

Ace-Tang commented Aug 9, 2018

@rudyfly , get the ci passed, then LGTM, except a question: would mount in pouchd meet the mount too many layers caused over page limit problem.

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.

5 participants