-
Notifications
You must be signed in to change notification settings - Fork 947
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
bugfix: fix error to set volume options #2798
Conversation
using pouch cli to run container, command is: ```bash # pouch run -d -v /tmp/test:/tmp/test:rslave,ro busybox top ``` it will parse `-v` become to bind ["/tmp/test:/tmp/test:rslave", "ro"] by default, `,` is separator of command, so we should refact the default rules. Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #2798 +/- ##
==========================================
- Coverage 69.41% 69.34% -0.08%
==========================================
Files 277 278 +1
Lines 17321 17340 +19
==========================================
+ Hits 12024 12025 +1
- Misses 3967 3975 +8
- Partials 1330 1340 +10
|
Since this pr is cherry-pick from intenal branch, reviewed! LGTM |
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.
Nit. but LGTM
@rudyfly please add other pr to remove the comment line.
@@ -89,7 +90,8 @@ func addCommonFlags(flagSet *pflag.FlagSet) *container { | |||
|
|||
flagSet.StringVar(&c.utsMode, "uts", "", "UTS namespace to use") | |||
|
|||
flagSet.StringSliceVarP(&c.volume, "volume", "v", nil, "Bind mount volumes to container, format is: [source:]<destination>[:mode], [source] can be volume or host's path, <destination> is container's path, [mode] can be \"ro/rw/dr/rr/z/Z/nocopy/private/rprivate/slave/rslave/shared/rshared\"") | |||
flagSet.VarP(config.NewVolumes(&c.volume), "volume", "v", "Bind mount volumes to container, format is: [source:]<destination>[:mode], [source] can be volume or host's path, <destination> is container's path, [mode] can be \"ro/rw/dr/rr/z/Z/nocopy/private/rprivate/slave/rslave/shared/rshared\"") | |||
//flagSet.StringSliceVarP(&c.volume, "volume", "v", nil, "Bind mount volumes to container, format is: [source:]<destination>[:mode], [source] can be volume or host's path, <destination> is container's path, [mode] can be \"ro/rw/dr/rr/z/Z/nocopy/private/rprivate/slave/rslave/shared/rshared\"") |
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.
could we remove the comment line if we don't need it?
using pouch cli to run container, command is:
# pouch run -d -v /tmp/test:/tmp/test:rslave,ro busybox top
it will parse
-v
become to bind ["/tmp/test:/tmp/test:rslave", "ro"]by default,
,
is separator of command, so we should refact the defaultrules.
Signed-off-by: Rudy Zhang rudyflyzhang@gmail.com
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
none
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
added
Ⅳ. Describe how to verify it
ci pass
Ⅴ. Special notes for reviews