Commit Graph

74 Commits

Author SHA1 Message Date
W. Trevor King 5bf9b95c45 schema/defs-linux: Fix type for seccomp names
The:

  "type": [
    "string"
  ]

syntax added in 652323cd (improve seccomp format to be more
expressive, 2017-01-13, #657) is not valid:

  $ ./validate ./config-schema.json <../config.json
  The document is not valid. see errors :
  - linux.seccomp.syscalls.0.names: Invalid type. Expected: string, given: array

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-03-06 12:15:47 -08:00
zhouhao 513ab686e9 Add new architectures from libseccomp 2.3.2
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-03-02 14:33:06 +08:00
Mrunal Patel 40474dd78c Merge pull request #704 from hqhq/use_uint64_for_memory
Set specs value the same as kernel API input
2017-03-01 14:05:37 -08:00
Qiang Huang 2db839104d Merge pull request #699 from crosbymichael/mount-optional
Make mount type and source optional
2017-02-28 20:05:03 -08:00
Qiang Huang ec9449187b Set specs value the same as kernel API input
This partially revert #648 , after a second thought, I think we
should use specs value the same as kernel API input, see:
https://github.com/opencontainers/runtime-spec/issues/692#issuecomment-281889852

For memory and hugetlb limits *.limit_in_bytes, cgroup APIs take the values
as string, but the parsed values are unsigned long, see:
https://github.com/torvalds/linux/blob/v4.10/mm/page_counter.c#L175-L193

For `cpu.cfs_quota_us` and `cpu.rt_runtime_us`, cgroup APIs take the input
value as signed long long, while `cpu.cfs_period_us` and `cpu.rt_periof_us`
take the input value as unsigned long long.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-03-01 09:10:43 +08:00
Michael Crosby 52461516ea Make mount type and source optional
These are optional on multiple platforms and should be left up to the
runtime/host system for validation.

Closes #470

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-02-28 13:50:18 -08:00
Mrunal Patel 2d491b03fa Merge pull request #694 from q384566678/state-json
state-schema.json: add the value of status
2017-02-27 11:19:26 -08:00
Mrunal Patel fb76f47bf4 Merge pull request #696 from q384566678/json-fix
Fix config-schema.json
2017-02-27 11:19:04 -08:00
zhouhao ec49ba1ada remove mounts from required
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-02-27 09:29:01 +08:00
zhouhao 0a8ef1d7b5 config-schema.json: add required
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-02-27 09:27:04 +08:00
Mrunal Patel ae7a541930 Merge pull request #657 from GrantSeltzer/improve-seccomp-spec
config: Improve seccomp format to be more expressive
2017-02-24 18:59:49 -08:00
zhouhao 7ec622e5c3 state-schema.json: add the value of status
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-02-24 13:33:54 +08:00
grantseltzer 652323cd77 improve seccomp format to be more expressive
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
2017-02-22 18:17:16 -05:00
Mrunal Patel ac9f8e0b5f Merge pull request #675 from crosbymichael/caps
Add ambient and bounding capability support
2017-02-22 14:59:11 -08:00
Michael Crosby eb114f0570 Add ambient and bounding capability support
Closes #668

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-02-22 14:47:51 -08:00
Mrunal Patel 8c22b690a4 Merge pull request #688 from Mashimiao/schema-fix-device-required
schema: remove major,minor from device required items
2017-02-17 10:18:30 -08:00
Ma Shimiao 0e808fcad0 schema: remove major,minor from device required items
When type is p, major and minor is not required.
So, we should not leave them in require.

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-14 14:15:12 +08:00
Ma Shimiao fcd62099ff config.md: args of Hooks should be optional
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-09 09:45:42 +08:00
Vincent Batts 67c81aa3c6 Merge pull request #684 from Mashimiao/schema-fix-invalid-types
schema: fix invalid types
2017-02-08 15:24:26 -05:00
Ma Shimiao 4100020dfc schema: fix invalid types
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-08 16:35:45 +08:00
Deng Guangxing 21ee162b42 add explicit usage message to validate and some fix
this commit contains:
* add explicit usage message to validate
* schemaPath was overrided by filepath.Abs(), schemaLoader would not get
* the abs path.
* check local scheme and document file path with os.Stat()

Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
2017-02-08 15:18:18 +08:00
Qiang Huang 2392e66f16 Merge pull request #674 from crosbymichael/state
Rename bundlePath to bundle
2017-02-06 10:43:17 +08:00
Michael Crosby 5d3f1674e6 Rename bundlePath to bundle
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-02-02 13:10:54 -08:00
W. Trevor King 092743727e schema: Drop pointers and nulls
Maintainers feel (and I agree) that there's no point in explicitly
allowing a null value when callers can simply leave the property unset
[1].  This commit removes all references to "pointer" and "null" from
the JSON Schema to support that decision.  While optional properties
may sometimes be represented as pointer types in Go [2], optional
properties should be represented in JSON Schema by not including the
properties in the 'required' array.

[1]: https://github.com/opencontainers/runtime-spec/pull/555#issuecomment-272020515
[2]: style.md "Optional settings should not have pointer Go types"

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-01-23 11:23:44 -08:00
Michael Crosby d5a1269c87 Merge pull request #545 from Mashimiao/fix-blockio-related-validation
fix blkio related validation
2017-01-23 10:32:27 -08:00
Ma Shimiao 1b3e2c7f26 schema: fix invalid string reference
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-01-23 11:49:22 +08:00
Vincent Batts dc0fa75942 Merge pull request #655 from Mashimiao/schema-fix-with-latest-spec
schema: fix items based on latest spec
2017-01-18 17:29:21 -05:00
Mrunal Patel 937ea7bc5c Merge pull request #490 from wking/json-schema-validate-http-schema
schema/validate: Allow schema identifiers to contain a URL scheme
2017-01-18 14:13:33 -08:00
Mrunal Patel b12752e3ab Merge pull request #656 from wking/string-pointer-fixups
schema: Remove string pointers
2017-01-18 09:50:51 -08:00
W. Trevor King 83200898a1 schema: Remove string pointers
Catch up with 868e6310 (Remove string pointers, 2017-01-12, #653).

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-01-13 07:09:36 -08:00
Ma Shimiao 5076439d49 schema: fix items based on latest spec
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-01-13 13:59:16 +08:00
Ma Shimiao fa74102768 defs.json: add misssing int64Pointer
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-01-12 16:43:54 +08:00
Ma Shimiao 58832f9148 config-linux: remove unneeded null for array
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-01-12 14:59:40 +08:00
Ma Shimiao a04cce97ea fix blkio related validation
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-01-12 14:56:27 +08:00
Mrunal Patel a3dd52f583 Merge pull request #646 from q384566678/json-test
Perfect json content
2017-01-11 14:24:24 -08:00
Qiang Huang 4b42ec4480 Merge pull request #648 from hqhq/all_negative_value
Allow negative value for some resource fields
2017-01-09 21:00:19 -06:00
zhouhao 2d5e0df2f0 Perfect json content
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-01-06 10:34:38 +08:00
Qiang Huang 082e93a2bd Allow negative value for some resource fields
Carry #499

For these values, cgroup kernal APIs accept -1 to set
them as unlimited, as docker and runc all support
update resources, we should not set drawbacks in spec.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-01-05 19:03:57 +08:00
W. Trevor King a78f255982 config: Explicitly list 'hooks' as optional
And make it omitempty, otherwise:

  $ ocitools generate --template <(echo '{}')
  $ cat config.json | jq -S .
  {
    "hooks": {},
    ...
  }

To provide space for the type information and 'optional', I've
shuffled the hook docs to follow our usual:

  * **`{property}`** ({type}, {when-needed}) {notes}

format.  I've kept the separate event-trigger sections (e.g. "###
Prestart") since they go into more detail on the timing, purpose, and
exit handling for the different events (and that seemed like too much
information to put into the nested lists).

I've replaced the Go reference from 48049d2 (Clarify the semantics of
hook elements, 2015-11-25, #255) with POSIX references (following the
new process docs) to address pushback against referencing Go [1,2] in
favor of POSIX links [3].  Rob Dolin had suggested
"platform-appropriate" wording [4], but it seems like Visual Studio
2015 supports execv [5], and providing an explicit
"platform-appropriate" wiggle seems like it's adding useless
complication.

[1]: https://github.com/opencontainers/runtime-spec/pull/427#discussion_r62362761
[2]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-05-18-17.01.log.html#l-46
[3]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-05-18-17.01.log.html#l-52
[4]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-05-18-17.01.log.html#l-54
[5]: https://msdn.microsoft.com/en-us/library/886kc0as.aspx

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-01-04 14:12:16 -08:00
Mike Frysinger 7872d3ddff schema: update major/minor types
This matches the config-linux.md spec which says these are both int64.

Signed-off-by: Mike Frysinger <vapier@chromium.org>
2016-11-04 20:10:56 -04:00
John Howard dc8f2c2e6e Add support for Windows-based containers
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-22 12:13:04 -07:00
W. Trevor King 90be62f150 schema: Run 'make fmt'
This should probably be part of our CI testing.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-08-30 15:46:26 -07:00
Mrunal Patel b860409a5a Merge pull request #546 from Mashimiao/seccomp-remove-unneeded-item
remove unneeded item from seccomp
2016-08-30 15:43:59 -07:00
Michael Crosby 4a910f0711 Merge pull request #550 from Mashimiao/add-devicecgroup-and-devices
add devices for resources and DeviceCgroup
2016-08-30 13:42:07 -07:00
Ma Shimiao 50f36a4148 add timeout for Hook
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2016-08-30 13:41:37 +08:00
Ma Shimiao 60672c0b3c add devices for resources and DeviceCgroup
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2016-08-30 13:31:01 +08:00
Ma Shimiao 7d22f1c244 remove unneeded item from seccomp
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2016-08-29 15:33:23 +08:00
Mrunal Patel 8095e4eb4e Merge pull request #528 from hmeng-19/add_missing_type
Add missing `"type": "object"`
2016-08-17 15:54:40 -07:00
Haiyan Meng da3b96e996 Add missing `"type": "object"`
Signed-off-by: Haiyan Meng <haiyanalady@gmail.com>
2016-08-10 17:14:25 -04:00
W. Trevor King d7b8877547 config: Consistent Markdown/Go/JSON-Schema wording for 'root'
I've also added our usual:

  (<type>, <required|optional>)

to the Markdown so folks can see that this is a required object.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-08-03 00:16:24 -07:00