diff --git a/schema/config-linux.json b/schema/config-linux.json index 518b71ae7..1f44306bd 100644 --- a/schema/config-linux.json +++ b/schema/config-linux.json @@ -89,7 +89,10 @@ "id": "https://opencontainers.org/schema/bundle/linux/resources/pids/limit", "$ref": "defs.json#/definitions/int64" } - } + }, + "required": [ + "limit" + ] }, "blockIO": { "id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO", @@ -222,7 +225,11 @@ "limit": { "$ref": "defs.json#/definitions/uint64" } - } + }, + "required": [ + "pageSize", + "limit" + ] } }, { 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/schema/defs-linux.json b/schema/defs-linux.json index 9ccad6b06..542e8a6ab 100644 --- a/schema/defs-linux.json +++ b/schema/defs-linux.json @@ -106,6 +106,12 @@ }, "Device": { "type": "object", + "required": [ + "type", + "path", + "major", + "minor" + ], "properties": { "type": { "$ref": "#/definitions/FileType" @@ -249,7 +255,10 @@ "access": { "$ref": "defs.json#/definitions/stringPointer" } - } + }, + "required": [ + "allow" + ] }, "NetworkInterfacePriority": { "type": "object", @@ -260,7 +269,11 @@ "priority": { "$ref": "defs.json#/definitions/uint32" } - } + }, + "required": [ + "name", + "priority" + ] }, "NamespaceType": { "type": "string", @@ -283,7 +296,10 @@ "path": { "$ref": "defs.json#/definitions/FilePath" } - } + }, + "required": [ + "type" + ] } } } diff --git a/schema/defs.json b/schema/defs.json index aa03170af..97d18a20b 100644 --- a/schema/defs.json +++ b/schema/defs.json @@ -163,7 +163,12 @@ "size": { "$ref": "#/definitions/uint32" } - } + }, + "required": [ + "hostID", + "containerID", + "size" + ] }, "Mount": { "type": "object", 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"` }