-
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
config: platform dependent reference source #310
Conversation
// User specifies linux specific user and group information for the container's | ||
// main process. | ||
type User struct { | ||
// UID is the user ID the Process is executed as. (this field is platform dependent) |
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 we use a json tag to indicate platform dependency? It will help with tooling as well.
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.
Good idea
On Wed, Jan 13, 2016, 15:57 Vish Kannan [email protected] wrote:
In config.go
#310 (comment):@@ -33,6 +33,17 @@ type Process struct {
Cwd stringjson:"cwd"
}+// User specifies linux specific user and group information for the container's
+// main process.
+type User struct {
- // UID is the user ID the Process is executed as. (this field is platform dependent)
Should we use a json tag to indicate platform dependency? It will help
with tooling as well.—
Reply to this email directly or view it on GitHub
https://github.com/opencontainers/specs/pull/310/files#r49670377.
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 these tags be added to all Linux specific fields? It is perfectly fine to tackle that in a separate PR, if you agree.
These tags can help with validation.
LGTM |
On Wed, Jan 13, 2016 at 03:53:12PM -0800, Vincent Batts wrote:
+1 on this PR and its punt, but until we have no platform-specific |
a23a5c8
to
4d1b2d2
Compare
4d1b2d2
to
49a6f9d
Compare
This PR now addresses all the platform dependent source, not just the |
PTAL |
looks nice |
"name": "proc", | ||
"path": "/proc" | ||
"name": "proc", | ||
"path": "/proc" |
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.
Most of our other JSON examples use four-space indents, so we probably just want a blanket s/^/ /
on this block instead of dropping to two-space indents.
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.
And either way, this seems orthogonal to platform-dependent Go types ;).
On Thu, Jan 14, 2016 at 01:56:28PM -0800, Vincent Batts wrote:
You squashed config-linux.md into config.md but left |
* **`additionalGids`** (array of ints, optional) specifies additional group ids to be added to the process. | ||
* **`uid`** (int, required on Linux) specifies the user id. | ||
* **`gid`** (int, required on Linux) specifies the group id. | ||
* **`additionalGids`** (array of ints, optional on Linux) specifies additional group ids to be added to the process. |
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 already said "For Linux-based systems the user structure has the following fields", isn't this additional change kind of redundant?
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'll drop that part of the sentence
Is the plan to remove |
@hqhq that's a fair point |
On Fri, Jan 15, 2016 at 01:29:00AM -0800, Qiang Huang wrote:
Combining the Go (or just changing __linux.go to something else. Does |
I have a preference for one file with sections for platform specific stuff. Less of a chance of having to duplicate things (and keep them in-sync). And it easier to then compare the differences between what each platform expects. Besides, the size of these platform specific bits should be small. |
I started to do runtime*.md, but it was much longer. It was really an arbitrary decision. |
49a6f9d
to
ba06e26
Compare
@@ -33,6 +36,17 @@ type Process struct { | |||
Cwd string `json:"cwd"` | |||
} | |||
|
|||
// User specifies linux specific user and group information for the container's | |||
// main process. | |||
type User struct { |
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 this type be named LinuxUser
for the sake of readability?
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.
No, because the intention is that as other platforms have their own fields, they still fall in 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.
+1 and while in there perhaps renaming "Linux" above too - when I first saw Linux Linux ...
it made me laugh.
On Fri, Jan 15, 2016 at 10:19:34AM -0800, Doug Davis wrote:
Heh. $ git describe so 70% of our config docs are Linux specific, and that's not even
|
// SelinuxProcessLabel specifies the selinux context that the container process is run as. | ||
SelinuxProcessLabel string `json:"selinuxProcessLabel"` | ||
// Seccomp specifies the seccomp security settings for the container. | ||
Seccomp Seccomp `json:"seccomp"` |
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.
nit: Make this optional.
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.
and a pointer. got it.
3878a8d
to
bd8af9a
Compare
On Fri, Jan 15, 2016 at 10:34:21AM -0800, Vincent Batts wrote:
If we're not comfortable rolling that in, that's fine with me 1, and |
will need more rebasing, with #329 |
Rebased |
This introduces verbiage of fields that may occur in json (technically optional), but is required on certain platforms (e.g. Linux). The JSON document will look the same as it presently does, but now the reference source compiles regardless of platform. Not adding a "name" string to the user sturct, as that is not a requirement yet. In the event a windows runtime shows up, I could imagine an `sid` on the user struct, but we'll get to that when it happens. Closes opencontainers#135 Related to opencontainers#166 Signed-off-by: Vincent Batts <[email protected]>
Rebased |
@crosbymichael if you would give this a once-over. It ought not be a code/structure change at all. |
LGTM |
config: platform dependent reference source
Through eea2a6c (Merge pull request opencontainers#310 from vbatts/multi-platform, 2016-03-09). Signed-off-by: W. Trevor King <[email protected]>
Through eea2a6c (Merge pull request opencontainers#310 from vbatts/multi-platform, 2016-03-09). Signed-off-by: W. Trevor King <[email protected]>
These comments first landed in 820131d (*: flatten platform dependent source, 2016-03-08, opencontainers#310). But you can tell they're platform dependent by the platform:"..." tags. The Go comment doesn't add any additional information. Signed-off-by: W. Trevor King <[email protected]>
This introduces verbiage of fields that may occur in json (technically
optional), but is required on certain platforms (e.g. Linux).
Not adding a "name" string, as that is not a requirement yet.
In the event a windows runtime shows up, I could imagine an
sid
, butwe'll get to that when it happens.
Closes #135
Related to #166
Signed-off-by: Vincent Batts [email protected]