Fixes looking up mountinfo corresponds to path#1584
Fixes looking up mountinfo corresponds to path#1584mlaventure merged 1 commit intocontainerd:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1584 +/- ##
=======================================
Coverage 46.44% 46.44%
=======================================
Files 26 26
Lines 3542 3542
=======================================
Hits 1645 1645
Misses 1519 1519
Partials 378 378Continue to review full report at Codecov.
|
|
Thank you for PR, please add UT? |
There was a problem hiding this comment.
You can use https://golang.org/pkg/sort/#Slice instead of adding a new type.
|
@miaoyq Thanks for fixing this! |
|
LGTM |
|
If you have time can you write a quick unit test for this? We already have mountinfo output as a |
|
I think it's national holiday in China this week, let's give @miaoyq some time. :) |
@crosbymichael I'm sorry for delay, I have tried to test this with the I think maybe we could add unit test for this in testLookup.
@Random-Liu Thanks for your understanding. 🙂 |
|
@miaoyq ya, we can breakout the logic into an internal func that takes a io.Reader so that it can be unit tested. func Lookup() {
f, err := os.Open("/proc/sefl/mountinfo")
lookupMounts(f)
} |
|
@crosbymichael Seems to still can not add unit test for this,because |
7a98cae to
d7c4611
Compare
Signed-off-by: Yanqiang Miao <[email protected]>
|
@crosbymichael I have added unit test for this in testLookup. |
|
LGTM ping @mlaventure |
…c-for-runtime-options Revert "Fix doc for runtime specific options"
Signed-off-by: Yanqiang Miao [email protected]
I execute the mount comment like:
Then look up the mount info through
mount.Lookiup("/tmp"), and get the result like:But I expect getting the mount info like:
This PR ensure getting the correct mountinfo corresponds to path.
/cc @Random-Liu