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: refactor container update diskquota type #1572

Merged
merged 1 commit into from
Jun 22, 2018

Conversation

rudyfly
Copy link
Collaborator

@rudyfly rudyfly commented Jun 21, 2018

Ⅰ. Describe what this PR did

refactor container update diskquota type, change it from string to
map[string]string, make it consistent with container create api.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: Rudy Zhang [email protected]

@@ -16,4 +16,8 @@ type ContainerPlugin interface {
// and if this endpoint should enable resolver and a map which will be used as generic params to create endpoints of
// this container
PreCreateEndpoint(string, []string) (priority int, disableResolver bool, genericParam map[string]interface{})

// PreUpdate defines plugin point where receives an container update request, in this plugin point user
Copy link
Contributor

Choose a reason for hiding this comment

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

%s/an/a 😆

cli/update.go Outdated
@@ -52,7 +51,7 @@ func (uc *UpdateCommand) addFlags() {
flagSet.StringSliceVarP(&uc.env, "env", "e", nil, "Set environment variables for container")
flagSet.StringSliceVarP(&uc.labels, "label", "l", nil, "Set label for container")
flagSet.StringVar(&uc.restartPolicy, "restart", "", "Restart policy to apply when container exits")
flagSet.StringVar(&uc.quota, "quota", "", "Update disk quota for container")
flagSet.StringSliceVar(&uc.diskQuota, "disk-quota", nil, "Update disk quota for container")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should add more details here in the command line usage. For exapmle, how to unset the original diskquota @rudyfly

cli/update.go Outdated
@@ -52,7 +51,7 @@ func (uc *UpdateCommand) addFlags() {
flagSet.StringSliceVarP(&uc.env, "env", "e", nil, "Set environment variables for container")
flagSet.StringSliceVarP(&uc.labels, "label", "l", nil, "Set label for container")
flagSet.StringVar(&uc.restartPolicy, "restart", "", "Restart policy to apply when container exits")
flagSet.StringVar(&uc.quota, "quota", "", "Update disk quota for container")
flagSet.StringSliceVar(&uc.diskQuota, "disk-quota", nil, "Update disk quota for container")
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, in cli/common_flag we have already defined the diskQuota , so if we change the type to slice, no need define here.

refactor container update diskquota type, change it from `string` to
`map[string]string`, make it consistent with container create api.

Signed-off-by: Rudy Zhang <[email protected]>
@rudyfly rudyfly force-pushed the update-diskquota branch from 079e680 to b5d245e Compare June 21, 2018 11:55
@codecov-io
Copy link

Codecov Report

Merging #1572 into master will decrease coverage by 0.72%.
The diff coverage is 12.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1572      +/-   ##
==========================================
- Coverage   41.59%   40.87%   -0.73%     
==========================================
  Files         267      267              
  Lines       17366    17702     +336     
==========================================
+ Hits         7223     7235      +12     
- Misses       9251     9574     +323     
- Partials      892      893       +1
Impacted Files Coverage Δ
cli/update.go 0% <0%> (ø) ⬆️
apis/server/container_bridge.go 82.89% <14.28%> (-1.79%) ⬇️
daemon/mgr/container.go 45.27% <16.66%> (-5.39%) ⬇️
daemon/mgr/network.go 53.66% <0%> (-14.33%) ⬇️
pkg/user/user.go 49.23% <0%> (-14.11%) ⬇️
apis/server/server.go 39.39% <0%> (-9.36%) ⬇️

@HusterWan
Copy link
Contributor

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Jun 22, 2018
@HusterWan HusterWan merged commit 408d339 into AliyunContainerService:master Jun 22, 2018
@rudyfly rudyfly deleted the update-diskquota branch August 7, 2018 05:17
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.

5 participants