-
Notifications
You must be signed in to change notification settings - Fork 949
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
refactor: refactor container update diskquota type #1572
Conversation
apis/plugins/ContainerPlugin.go
Outdated
@@ -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 |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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]>
079e680
to
b5d245e
Compare
Codecov Report
@@ 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
|
LGTM |
Ⅰ. Describe what this PR did
refactor container update diskquota type, change it from
string
tomap[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]