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 pkg to correct places #1147

Merged
merged 1 commit into from
Apr 17, 2018

Conversation

allencloud
Copy link
Collaborator

@allencloud allencloud commented Apr 17, 2018

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

Ⅰ. Describe what this PR did

When I am learning the structure of package pkg, I find that there are at least three packages which should be moved out of it:

  • client
  • quota
  • runconfig

Here is my reason:
we usually keep totally general packages in package pkg, while three packages above are something specific, client is for control server or something like that, quota for filesystem quota for container, and runconfig is for pouch container's some kind of config parameter.

I wish we could add a folder which is named storage, then some structure may be like:

storage:
     \___volume
      \__quota
       \_ controlserver
                 \_client

Actually I am afraid the package name of client is not my dishes. Like the code makes me feel confused:

return client.JoinURL(c.BaseURL, types.APIVersion, client.StoragePath)

Here, I think client is a struct instance, however it is a package. So hard to understand and quite awkward.

Ⅱ. Does this pull request fix one issue?

fix #1051

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
@codecov-io
Copy link

Codecov Report

Merging #1147 into master will increase coverage by 0.38%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1147      +/-   ##
==========================================
+ Coverage   15.19%   15.58%   +0.38%     
==========================================
  Files         173      173              
  Lines        9705     9817     +112     
==========================================
+ Hits         1475     1530      +55     
- Misses       8125     8178      +53     
- Partials      105      109       +4
Impacted Files Coverage Δ
apis/opts/memory_swappiness.go 100% <ø> (ø)
apis/opts/cpu.go 0% <ø> (ø)
daemon/mgr/container.go 0% <ø> (ø) ⬆️
apis/opts/devicemappings.go 95.55% <ø> (ø)
daemon/mgr/spec_devices.go 0% <ø> (ø) ⬆️
apis/opts/oom_score.go 0% <ø> (ø)
apis/opts/spec_annotation.go 60% <ø> (ø)
apis/opts/mountpoint.go 84.61% <ø> (ø)
cli/update.go 0% <ø> (ø) ⬆️
storage/controlserver/client/httpcli.go 0% <ø> (ø)
... and 21 more

@rudyfly
Copy link
Collaborator

rudyfly commented Apr 17, 2018

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Apr 17, 2018
@rudyfly rudyfly merged commit 81e56b3 into AliyunContainerService:master Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor LGTM one maintainer or community participant agrees to merge the pull reuqest. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[refactor] move related packages out of pkg
4 participants