-
Notifications
You must be signed in to change notification settings - Fork 557
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
Aggressive namespacing #567
Aggressive namespacing #567
Conversation
On Wed, Sep 14, 2016 at 04:09:17PM -0700, John Howard wrote:
This is going to hurt, but it will only hurt more if we do it later So b88b924 looks good to me. I expect we will want to do some similar |
Let's try and keep to smaller incremental changes and handle namespacing in the JSON schema separately 😄 Thanks for all your quick reviews, @wking 👍 |
gotcha. though that does not affect the field names in the JSON. Which is both convenient for the time being, but also seems counter to the theme of what you're trying to accomplish, no? |
On Thu, Sep 15, 2016 at 07:27:31AM -0700, Vincent Batts wrote:
JSON keys are already namespaced (e.g. ‘"linux": {"resources": …}’). a. using LinuxResources in an all-platform config.go package (what I don't see a lot of meaningful difference between (a) and (b), and |
All for this , and agree it should be done sooner rather than later. |
We used to have |
@hqhq - There's two solutions, I'm just trying to follow the pattern that is in the current implementation. I honestly don't think there's going to be consensus in either direction, it's just necessary to stick to one and be done with it. We are already at a single file for Linux and Solaris. If the consensus was to have a |
I don't think it'd be a good idea to use |
I'm really sorry but I don't understand what you are suggesting. A - rather than _ is really no different. Regardless, it's orthogonal to this PR - I'm merely keeping to an existing behaviour and constructs to allow for a third platform where there IS a clash. |
@jhowardmsft In Go, |
On Sat, Sep 17, 2016 at 10:32:02PM -0700, Aleksa Sarai wrote:
I floated the hyphen form a while back and was told it was too |
Yup, I know about build vs _. - just seems odd to me. |
On Sat, Sep 17, 2016 at 10:36:45PM -0700, John Howard wrote:
I'm +1 to “any agressive namespacing is better than no agressive |
So it still sounds like this PR is good as it is and the tagging/file-naming/other re-org is a discussion for another PR. Or am I missing something still? Thanks. |
I feel that doing on per collision might be better. Maybe discuss this in tomorrows call? |
// Namespace is the configuration for a Linux namespace | ||
type Namespace struct { | ||
// LinuxNamespace is the configuration for a Linux namespace | ||
type LinuxNamespace struct { | ||
// Type is the type of Linux namespace | ||
Type NamespaceType `json:"type"` |
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.
You probably want NamespaceType
→ LinuxNamespaceType
too.
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.
Fixed in e918daa
Syscalls []Syscall `json:"syscalls,omitempty"` | ||
// LinuxSeccomp represents syscall restrictions | ||
type LinuxSeccomp struct { | ||
DefaultAction Action `json:"defaultAction"` |
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.
You probably want to namespace Action
→ LinuxSeccompAction
(or maybe SeccompAction
if we don't namespace Seccomp
). Operator
and Arg
are in the same boat.
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.
Fixed in e918daa, along with Operator
and Arg
On Tue, Sep 20, 2016 at 02:21:47PM -0700, Mrunal Patel wrote:
Discussing on the call is fine. The balance is between the pain of |
Signed-off-by: John Howard <[email protected]>
b88b924
to
e918daa
Compare
@mrunalp @wking As for all or nothing, or as things arise, my personal preference (obviously holding no weight in the decisions made in this repo) is that all now is a more prudent approach. Have a one-time hit to downstream consumers, with little likelyhood for future issues as new structures are added on a per-platform basis seems sensible. However, I'm looking forward to hearing the results of tomorrows call ☎️ |
Tagging @opencontainers/runtime-spec-maintainers to take a look per discussion on OCI Dev ConCall |
@mrunalp Would you please give this a look? |
LGTM (but would be open to any alternatives if possible). |
Since all the windows code is behind Isn't this the same problem as |
On Mon, Sep 26, 2016 at 10:45:56AM -0700, Michael Crosby wrote:
We had a structure like that before. It was flattened in #310 to |
@crosbymichael you're right but we want the reference code in the specs to not compile platform-dependently. |
Indeed, I think a strong use case would be a tool that operates on bundles in general (but doesn't ever execute them) being able to read/write for any platform. This PR seems sane IMO. |
@crosbymichael Given @vbatts's comment above, is this ready to be merged? |
Signed-off-by: John Howard [email protected]
@wking As per comment #504 (comment) on the proof of concept PR for adding Windows support to the OCI runtime spec, this does the "aggressive namespacing" for all Linux and Solaris structures. Fortunately it doesn't change any of the JSON in the documentation, but will unfortunately have a big knock-on effect to downstream consumers of
config.go
through thespecs
package.