-
Notifications
You must be signed in to change notification settings - Fork 950
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
feature: add lxcfs flag to cli #534
Conversation
cli/container.go
Outdated
@@ -91,5 +92,9 @@ func (c *container) config() (*types.ContainerCreateConfig, error) { | |||
} | |||
} | |||
|
|||
if c.enableLxcfs { | |||
config.EnableLxcfs = true |
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.
use config.EnableLxcfs = c.enableLxcfs
?
@@ -118,3 +118,23 @@ func (suite *PouchCreateSuite) TestCreateWithLabels(c *check.C) { | |||
c.Errorf("failed to set label: %s", label) | |||
} | |||
} | |||
|
|||
// TestCreateEnableLxcfs tries to test create a container with lxcfs. | |||
func (suite *PouchCreateSuite) TestCreateEnableLxcfs(c *check.C) { |
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 currently pouchd has enabled lxcfs by default, right? @CodeJuan @Letty5411
Then it seems these test setting enablelxcfs does not work as expected, right?
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.
It's causeed by the environment.
The output of pouch run --enableLxcfs=true docker.io/library/busybox:latest cat /proc/uptime
was 0.0 0.0
on my machine, so I set the expected value=0.0 0.0
, but the output of CI was 0.00 0.00
315dd37
to
c0424cb
Compare
Codecov Report
@@ Coverage Diff @@
## master #534 +/- ##
======================================
Coverage 17.2% 17.2%
======================================
Files 38 38
Lines 2040 2040
======================================
Hits 351 351
Misses 1653 1653
Partials 36 36 Continue to review full report at Codecov.
|
Signed-off-by: codejuan <[email protected]>
@@ -28,6 +28,7 @@ type container struct { | |||
memorySwap string | |||
memorySwappiness int64 | |||
devices []string | |||
enableLxcfs bool | |||
} | |||
|
|||
func (c *container) config() (*types.ContainerCreateConfig, error) { |
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 this function is a little bit in mess, and we need to make it more clear.
LGTM |
1.Describe what this PR did
Add lxcfs flag to cli
2.Does this pull request fix one issue?
3.Describe how you did it
4.Describe how to verify it
the value of EnableLxcfs should be true.
the output should be equal to "0.0 0.0"
5.Special notes for reviews