-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
libct/configs/validate: allow / in sysctl names #3254
Conversation
Runtime spec says: > sysctl (object, OPTIONAL) allows kernel parameters to be modified at > runtime for the container. For more information, see the sysctl(8) > man page. and sysctl(8) says: > variable > The name of a key to read from. An example is > kernel.ostype. The '/' separator is also accepted in place of a '.'. Apparently, runc config validator do not support sysctls with / as a separator. Fortunately this is a one-line fix. Add some more test data where / is used as a separator. Signed-off-by: Kir Kolyshkin <[email protected]>
ac041ad
to
972aea3
Compare
"fs/mqueue/ctl": "ctl", | ||
"net.ctl": "ctl", | ||
"net/ctl": "ctl", | ||
"kernel.ctl": "ctl", | ||
"kernel/ctl": "ctl", |
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.
In the unit test, the sysctl value with existing dots and slashes is also added.
@@ -150,6 +150,7 @@ func (v *ConfigValidator) sysctl(config *configs.Config) error { | |||
) | |||
|
|||
for s := range config.Sysctl { | |||
s := strings.Replace(s, "/", ".", -1) |
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 there is a problem with your conversion:
If the ssyctl value is net/pv4/conf/eno2.100/rp_filter
The correct conversion result should be net.ipv4.conf.eno2/100.rp_filter
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.
@mengjiao-liu Could you open a github issue?
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.
Ok, I will open a issue.
Runtime spec says:
and sysctl(8) says:
Apparently, runc config validator do not support sysctls with
/
as aseparator. Fortunately this is a one-line fix.
Add some more test data where
/
is used as a separator.Related to: kubernetes/kubernetes#102393