Commit Graph

28 Commits

Author SHA1 Message Date
W. Trevor King f2cc9fdb60 config: Update 'OpenContainer specification' wording
Catch up with the spec title from faad7e0f (README: title rename,
2016-04-04, #365).

Also make the Go comment consistent with the Markdown spec (no need to
maintain two phrasings for the same idea).  The only difference
between the phrasings is now some shuffling at the beginning to start
off with the property name (to keep godoc happy).

The JSON Schema entry (in defs.json) is different too, because it has
to apply to both the configuration and state JSON, so mentioning
"bundle" makes less sense than mentioning "document".

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-08-02 23:41:05 -07:00
Michael Crosby b45aa77484 Merge pull request #502 from wking/optional-linux-solaris
specs-go/config: Make Linux and Solaris omitempty (again)
2016-06-24 15:39:51 -07:00
John Howard c601539f01 Typo in apparmorprofile comment
Signed-off-by: John Howard <John.Howard@microsoft.com>
2016-06-21 13:53:58 -07:00
W. Trevor King 63231576ec specs-go/config: Make Linux and Solaris omitempty (again)
I'd added some omitempties in 5c2193f3 (specs-go/config: Make Linux
and Solaris omitempty, 2016-05-06, #431), but it turns out to not have
the intended effect unless the field is also a pointer type (even
after I shifted the 'omitempty' from the platform tag to the json
tag).  Before this commit:

  $ ./ocitools generate --template <(echo '{}')
  $ jq . config.json
  {
    "ociVersion": "1.0.0-rc1-dev",
    "platform": {
      "os": "linux",
      "arch": "amd64"
    },
    "process": {
      "user": {
        "uid": 0,
        "gid": 0
      },
      "args": [],
      "cwd": "/"
    },
    "root": {
      "path": "rootfs"
    },
    "hooks": {},
    "linux": {
      "cgroupsPath": ""
    },
    "solaris": {
      "cappedCPU": {},
      "cappedMemory": {}
    }
  }

And after this commit:

  $ ./ocitools generate --template <(echo '{}')
  $ jq . config.json
  {
    "ociVersion": "1.0.0-rc1-dev",
    "platform": {
      "os": "linux",
      "arch": "amd64"
    },
    "process": {
      "user": {
        "uid": 0,
        "gid": 0
      },
      "args": [],
      "cwd": "/"
    },
    "root": {
      "path": "rootfs"
    },
    "hooks": {},
  }

The remaining useless properties are addressed by other in-flight pull
requests:

* 5ca74df (config: Make 'process.args' optional, 2016-06-04, #489)
* ad33f9c (config: Explicitly list 'hooks' as optional, 2016-05-06,
  #427)

So I've left them alone here.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-06-17 22:14:48 -07:00
Abhijeeth Nuthan 2c41403b86 Correction to User struct in specs-go/config.json
Signed-off-by: Abhijeeth Nuthan <abhijeeth.nuthan@oracle.com>
2016-06-09 11:42:30 -07:00
Vincent Batts 831d961964 Merge pull request #397 from cyphar/add-cgroup-namespace
*: add support for cgroup namespace
2016-06-03 13:45:27 -04:00
Aleksa Sarai ce19b8d167 *: add support for cgroup namespace
The cgroup namespace is a new kernel feature available in 4.6+ that
allows a container to isolate its cgroup hierarchy. This currently only
allows for hiding information from /proc/self/cgroup, and mounting
cgroupfs as an unprivileged user. In the future, this namespace may
allow for subtree management by a container.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-06-04 00:14:39 +10:00
Michael Holzheu bb287dd5d7 seccomp: Add ppc and s390x to specs-go/config.go
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2016-06-01 11:52:31 -04:00
W. Trevor King 1fa80d2ca6 specs-go/config: Drop platform-independent comment
This has been stale since cb2da543 (config: Single, unified config
file, 2015-12-28, #284), when we dropped the attempt to distinguish
between platform-independent and platform-dependent configuration.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-24 14:18:53 -07:00
Qiang Huang be7676409b Merge pull request #429 from wking/terminal-omitempty
specs-go/config.go: Make Process.Terminal omitempty
2016-05-10 17:23:43 +08:00
Qiang Huang d33a8e17cb Merge pull request #430 from wking/readonly-omitempty
specs-go/config.go: Make Root.Readonly omitempty
2016-05-10 17:21:30 +08:00
W. Trevor King 5c2193f357 specs-go/config: Make Linux and Solaris omitempty
Both fields are optional, so you could conceivably have neither.
However, in most cases folks will populate the one corresponding to
their platform.  The one that *doesn't* match their platform must not
show up, in order to avoid violating the:

  This should only be set if **`platform.os`** is ...

phrasing.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-06 23:58:09 -07:00
W. Trevor King f307cfc939 specs-go/config.go: Make Root.Readonly omitempty
It's an optional setting, and this change will fix the wordy:

  $ ocitools generate --template <(echo '{}')
  $ grep readonly config.json
      "readonly": false,

Instead, config.json will not contain a 'readonly' entry at all.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-06 22:16:10 -07:00
W. Trevor King 41e94ae3d5 specs-go/config.go: Make Process.Terminal omitempty
It's an optional setting, and this change will fix the wordy:

  $ ocitools generate --template <(echo '{}')
  $ grep terminal config.json
      "terminal": false,

Instead, config.json will not contain a 'terminal' entry at all.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-06 21:38:23 -07:00
Amit Saha 815ce4e2eb UID and GID for the main process are not optional
The spec requires UID and GID to be specified, so we shouldn't
ignore if they are not specified.

Signed-off-by: Amit Saha <amitsaha.in@gmail.com>
2016-05-06 10:41:51 +10:00
Abhijeeth Nuthan 7c9daebaa7 Introducing Solaris in OCI
Signed-off-by: Abhijeeth Nuthan <abhijeeth.nuthan@oracle.com>
2016-05-04 12:19:27 -07:00
W. Trevor King 440fc5b36e specs-go/config: Make Spec.Mounts omitempty (#408)
* specs-go/config: Make Spec.Mounts omitempty

Otherwise:

  $ ocitools generate --mount-cgroups=no --template <(echo {})
  $ grep mounts config.json
          "mounts": null,

The language in config.md#Mounts is:

> You can add array of mount points...

which I think means 'MAY'.

Signed-off-by: W. Trevor King <wking@tremily.us>

* config: Use 'MAY' (RFC 2119) for mounts

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-04-28 09:46:54 -04:00
Mrunal Patel e87d7d2ba9 Fix remnants from SelinuxProcessLabel to SelinuxLabel rename
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-04-22 13:51:31 -07:00
Mrunal Patel 7350d5e1f1 Add support for Selinux mount context labels
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-04-22 13:40:49 -07:00
Michael Crosby adcbe530a9 Add masked and readonly paths
Fixes #320

This adds the maskedPaths and readonlyPaths fields to the spec so that
proper masking and setting of files in /proc can be configured.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-01 10:46:41 -07:00
Mrunal Patel e23fbbb408 Merge pull request #346 from crosbymichael/hook-timeout
Add timeout field to hooks
2016-03-18 10:21:31 -07:00
Michael Crosby 5a3b1816b2 Add timeout field to hooks
So that runtimes don't lock up forever waiting on a hook to return I
added a timeout field.  This allows the author to specify the timeout in
seconds that they want the hook to run before aborting the hook and
container execution.

I think the hook is the proper place to specify a timeouot like this
because any type of overall timeout in the runtime will probably not
work for all hooks and will not be flexable enough.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-16 16:51:29 -07:00
Vincent Batts 4d4a07952e Merge pull request #340 from liangchenye/master
add omitempty to 'Devices
2016-03-16 13:27:20 -04:00
liangchenye 28cc423977 add omitempty to 'Device' and 'Namespace'
Signed-off-by: liangchenye <liangchenye@huawei.com>
2016-03-11 11:28:58 +08:00
Julian Friedman 9d9ed06d5e Move rlimits to process
Signed-off-by: Julian Friedman <julz.friedman@uk.ibm.com>
2016-03-10 09:44:43 +00:00
Vincent Batts 820131db4a *: flatten platform dependent source
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 https://github.com/opencontainers/specs/pull/135
Related to https://github.com/opencontainers/specs/issues/166

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-09 15:12:17 -05:00
W. Trevor King 59333dcf45 specs-go/config: Fix 'SelinuxProcessLabel' -> 'SelinuxLabel'
The label changed in 5a8a779f (Move process specific settings to
process, 2016-03-02, #329) and 7bf06d53 (source and schema:
differentiate with examples, 2015-12-18, #276) missed this instance
when rebasing around #329.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-03-09 12:00:51 -08:00
Vincent Batts 7bf06d53dd source and schema: differentiate with examples
The standard is on the JSON schema (not yet IETF spec JSON-schema), such
that it is not implemenations specific. Thus far, the reference has been
in how golang source renders the JSON documents.

Having the JSON source and the markdown documents in sync has been an
ongoing step to keep in sync.

Separating these two allows the golang source to continue being _a_
reference, but the JSON schema in the documentation to be _the_
reference.

As validation tooling is refined, then it will facilitate ensuring
the available golang source conforms to the reference JSON.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-09 19:18:20 +00:00