From b0228e5b84b50b74df98b681b6520cf85998e503 Mon Sep 17 00:00:00 2001 From: zhouhao Date: Thu, 5 Jan 2017 10:57:58 +0800 Subject: [PATCH] Perfect json content Signed-off-by: zhouhao --- schema/config-schema.json | 29 ++++++++++++++++++++++++++--- specs-go/config.go | 2 +- specs-go/state.go | 2 +- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/schema/config-schema.json b/schema/config-schema.json index 95113a800..00cf81997 100644 --- a/schema/config-schema.json +++ b/schema/config-schema.json @@ -59,6 +59,9 @@ "description": "Configures the container's root filesystem.", "id": "https://opencontainers.org/schema/bundle/root", "type": "object", + "required": [ + "path" + ], "properties": { "path": { "id": "https://opencontainers.org/schema/bundle/root/path", @@ -82,6 +85,24 @@ "id": "https://opencontainers.org/schema/bundle/process/args", "$ref": "defs.json#/definitions/ArrayOfStrings" }, + "consoleSize": { + "id": "https://opencontainers.org/schema/bundle/process/consoleSize", + "type": "object", + "required": [ + "height", + "width" + ], + "properties": { + "height": { + "id": "https://opencontainers.org/schema/bundle/process/consoleSize/height", + "$ref": "defs.json#/definitions/unit64" + }, + "width": { + "id": "https://opencontainers.org/schema/bundle/process/consoleSize/width", + "$ref": "defs.json#/definitions/unit64" + } + } + }, "cwd": { "id": "https://opencontainers.org/schema/bundle/process/cwd", "type": "string" @@ -97,6 +118,10 @@ "user": { "id": "https://opencontainers.org/schema/bundle/process/user", "type": "object", + "required": [ + "uid", + "gid" + ], "properties": { "uid": { "id": "https://opencontainers.org/schema/bundle/process/user/uid", @@ -170,8 +195,6 @@ "ociVersion", "platform", "process", - "root", - "mounts", - "hooks" + "root" ] } diff --git a/specs-go/config.go b/specs-go/config.go index 0166f46b3..e00ec3e08 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -17,7 +17,7 @@ type Spec struct { // Mounts configures additional mounts (on top of Root). Mounts []Mount `json:"mounts,omitempty"` // Hooks configures callbacks for container lifecycle events. - Hooks Hooks `json:"hooks"` + Hooks Hooks `json:"hooks,omitempty"` // Annotations contains arbitrary metadata for the container. Annotations map[string]string `json:"annotations,omitempty"` diff --git a/specs-go/state.go b/specs-go/state.go index a74874ed5..cecfa408e 100644 --- a/specs-go/state.go +++ b/specs-go/state.go @@ -13,5 +13,5 @@ type State struct { // BundlePath is the path to the container's bundle directory. BundlePath string `json:"bundlePath"` // Annotations are the annotations associated with the container. - Annotations map[string]string `json:"annotations"` + Annotations map[string]string `json:"annotations,omitempty"` }