-
Notifications
You must be signed in to change notification settings - Fork 550
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
Add Go types for specification #51
Conversation
3450504
to
f25e5fc
Compare
LGTM |
// Linux contains platform specific configuration for linux based containers. | ||
type Linux struct { | ||
// UidMapping specifies user mappings for supporting user namespaces on linux. | ||
UidMapping []IDMapping `json:"uidMapping"` |
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.
Maybe pluralize like the other fields?
This adds Go types implementing the configuration specification. Signed-off-by: Michael Crosby <[email protected]>
// Rlimits specifies rlimit options to apply to the container's process. | ||
Rlimits []Rlimit `json:"rlimits"` | ||
// SystemProperties are a set of key value pairs that are set for the container on start. | ||
SystemProperties map[string]string `json:"systemProperties"` |
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.
If we get in opencontainers/runc#73 then might save the rename to sysctl after ;)
I can rebase later however :)
LGTM |
Add Go types for specification
It's backed by memory.oom_control, so this commit moves it in with the rest of the memory-controller config. Looking at the history, the initial request landing a setting for this in the Docker/OCI ecosystem seems to be [1], which added Cgroup.OomKillDisable. That commit was carried from libcontainer into runC [2] where it is now Resources.OomKillDisable [3]. From runC it was carried into this repo (with some renaming) in [4]. Subsequent early doc updates landed in [5,6]. In none of those can I find discussion about why the setting is not already under memory. I expect the reason is that the runC structures are flat, so "under memory" is not a thing there. But in this spec, resources has per-controller sub-properties. The fact that disableOOMKiller belonged to the memory controller may have been overlooked in [4] and never revisited until now. [1]: docker-archive/libcontainer#417 Subject: cgroups: add support for oom control [2]: opencontainers/runc@295c708 Subject: cgroups: add support for oom control [3]: https://github.com/opencontainers/runc/blob/v1.0.0-rc3/libcontainer/configs/cgroup_unix.go#L113-L114 [4]: opencontainers#51 Subject: Add Go types for specification [5]: opencontainers#137 Subject: Adding cgroups path to the Spec. [6]: opencontainers#199 Subject: runtime: config: linux: add cgroups informations Signed-off-by: W. Trevor King <[email protected]>
This adds Go types implementing the configuration specification.
Closes #42
I also took the liberty to clean up the resource types because some of the names did not make sense at all and was pretty bad.
Signed-off-by: Michael Crosby [email protected]