libct/configs/validate: allow / in sysctl names#3254
Merged
mrunalp merged 1 commit intoopencontainers:masterfrom Oct 29, 2021
Merged
libct/configs/validate: allow / in sysctl names#3254mrunalp merged 1 commit intoopencontainers:masterfrom
mrunalp merged 1 commit intoopencontainers:masterfrom
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 <kolyshkin@gmail.com>
ac041ad to
972aea3
Compare
AkihiroSuda
approved these changes
Oct 29, 2021
mrunalp
approved these changes
Oct 29, 2021
mengjiao-liu
reviewed
Nov 1, 2021
Comment on lines
+191
to
+195
| "fs/mqueue/ctl": "ctl", | ||
| "net.ctl": "ctl", | ||
| "net/ctl": "ctl", | ||
| "kernel.ctl": "ctl", | ||
| "kernel/ctl": "ctl", |
There was a problem hiding this comment.
In the unit test, the sysctl value with existing dots and slashes is also added.
mengjiao-liu
reviewed
Nov 1, 2021
| ) | ||
|
|
||
| for s := range config.Sysctl { | ||
| s := strings.Replace(s, "/", ".", -1) |
There was a problem hiding this comment.
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
This was referenced Nov 1, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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