-
Notifications
You must be signed in to change notification settings - Fork 611
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
run: Add cgroup-parent flag #1782
Conversation
5f8137e
to
2d0f05b
Compare
2d0f05b
to
0a2b5f8
Compare
} | ||
|
||
if cpus > 0.0 || memStr != "" || memSwap != "" || pidsLimit > 0 { | ||
logrus.Warn("cgroup manager is set to \"none\", discarding resource limit requests. " + | ||
logrus.Warn(`cgroup manager is set to "none", discarding resource limit requests. ` + |
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.
Any reason for this change?
if cgroupManager == "none" { | ||
if !rootlessutil.IsRootless() { | ||
return nil, errors.New("cgroup-manager \"none\" is only supported for rootless") | ||
return nil, errors.New(`cgroup-manager "none" is only supported for rootless`) |
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.
Any reason for this change?
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.
Feel like raw string literals fit nicer than manually escaping quotes and other things. Also a habit from windows land where you'd commonly have to escape backslashes, so raw string literals came in handy there.
base := testutil.NewBase(t) | ||
info := base.Info() | ||
containerName := testutil.Identifier(t) | ||
defer base.Cmd("rm", "-f", containerName).Run() |
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.
Should be AssertOK; since bugs were found in the past of containers leaked out.
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.
Are you referring to the deferred cleanup? I was just following the standard set in most of the other tests in this file, but seems it's actually the lesser used of the two when taking into account all of the other tests; only run_cgroup_linux_test and run_mount_linux_test just defer Run
and call it a day. I'll open up a PR to swap the cgroup tests to using AssertOK
instead (and use AssertOK
here)
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.
Adds a test case and the functionality for cgroup-parent to match docker runs support. Signed-off-by: Danny Canter <danny@dcantah.dev>
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.
Thanks
Adds a test case and the functionality for cgroup-parent to match docker runs support.