Allow the runtime to use it's own scheme, but let the caller use UUIDs
if they want. Jonathan asked for clarification as part of #87, but
didn't suggest a particular approach [1]. When we discussed it in the
2015-08-26 meeting [2], the consensus was to just allow everything.
With container IDs like 'a/b/c' leading to state entries like
'/var/oci/containers/a/b/c/state.json'. But that could get ugly with
container IDs that contain '../' etc. And perhaps there are some
filesystems out there that cannot represent ASCII characters
(actually, I'm not even sure what charset our JSON is in ;). I'd
rather pick this minimal charset which can handle UUIDs, and make life
easy for runtime implementers and safe for bundle consumers at a
slight cost of flexibility for bundle-authors.
[1]:
https://github.com/opencontainers/specs/pull/87#discussion_r35828046
[2]:
https://github.com/opencontainers/specs/wiki/Meeting-Minutes-2015-08-26
Reported-by: Jonathan Boulle <
jonatha...@gmail.com>
Signed-off-by: W. Trevor King <
wk...@tremily.us>
---
This seems like a significant-enough semantic change to be worth
discussing on the list before I file a PR (although I've pushed this
commit if folks want to pull it [3]). I thought the patch format
would help clarify the changes I was suggesting.
Does anyone have a use case for container IDs outside the range I'm
suggesting?
Cheers,
Trevor
[3]:
https://github.com/wking/opencontainer-specs/tree/container-ID-charset-and-uniqueness
runtime.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/runtime.md b/runtime.md
index be50458..673db9e 100644
--- a/runtime.md
+++ b/runtime.md
@@ -11,6 +11,9 @@ By providing a default location that container state is stored external applicat
* **version** (string) Version of the OCI specification used when creating the container.
* **id** (string) ID is the container's ID.
+ Only ASCII letters, numbers, and hyphens are valid.
+ This value must be unique for a given host, but need not be universally unique.
+ Runtimes must allow the caller to set this ID, so that callers may choose, for example, to use [UUIDs][uuid] for universal uniqueness.
* **pid** (int) Pid is the ID of the main process within the container.
* **root** (string) Root is the path to the container's bundle directory.
@@ -86,3 +89,5 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
```
`path` is required for a hook. `args` and `env` are optional.
+
+[uuid]:
https://tools.ietf.org/html/rfc4122
--
2.1.0.60.g85f0837