Skip to content

Commit 2d5e0df

Browse files
author
zhouhao
committed
Perfect json content
Signed-off-by: zhouhao <[email protected]>
1 parent ced3365 commit 2d5e0df

File tree

5 files changed

+56
-7
lines changed

5 files changed

+56
-7
lines changed

schema/config-linux.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@
8989
"id": "https://opencontainers.org/schema/bundle/linux/resources/pids/limit",
9090
"$ref": "defs.json#/definitions/int64"
9191
}
92-
}
92+
},
93+
"required": [
94+
"limit"
95+
]
9396
},
9497
"blockIO": {
9598
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO",
@@ -222,7 +225,11 @@
222225
"limit": {
223226
"$ref": "defs.json#/definitions/uint64"
224227
}
225-
}
228+
},
229+
"required": [
230+
"pageSize",
231+
"limit"
232+
]
226233
}
227234
},
228235
{

schema/config-schema.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
"description": "Configures the container's root filesystem.",
6060
"id": "https://opencontainers.org/schema/bundle/root",
6161
"type": "object",
62+
"required": [
63+
"path"
64+
],
6265
"properties": {
6366
"path": {
6467
"id": "https://opencontainers.org/schema/bundle/root/path",
@@ -82,6 +85,24 @@
8285
"id": "https://opencontainers.org/schema/bundle/process/args",
8386
"$ref": "defs.json#/definitions/ArrayOfStrings"
8487
},
88+
"consoleSize": {
89+
"id": "https://opencontainers.org/schema/bundle/process/consoleSize",
90+
"type": "object",
91+
"required": [
92+
"height",
93+
"width"
94+
],
95+
"properties": {
96+
"height": {
97+
"id": "https://opencontainers.org/schema/bundle/process/consoleSize/height",
98+
"$ref": "defs.json#/definitions/unit64"
99+
},
100+
"width": {
101+
"id": "https://opencontainers.org/schema/bundle/process/consoleSize/width",
102+
"$ref": "defs.json#/definitions/unit64"
103+
}
104+
}
105+
},
85106
"cwd": {
86107
"id": "https://opencontainers.org/schema/bundle/process/cwd",
87108
"type": "string"

schema/defs-linux.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@
106106
},
107107
"Device": {
108108
"type": "object",
109+
"required": [
110+
"type",
111+
"path",
112+
"major",
113+
"minor"
114+
],
109115
"properties": {
110116
"type": {
111117
"$ref": "#/definitions/FileType"
@@ -249,7 +255,10 @@
249255
"access": {
250256
"$ref": "defs.json#/definitions/stringPointer"
251257
}
252-
}
258+
},
259+
"required": [
260+
"allow"
261+
]
253262
},
254263
"NetworkInterfacePriority": {
255264
"type": "object",
@@ -260,7 +269,11 @@
260269
"priority": {
261270
"$ref": "defs.json#/definitions/uint32"
262271
}
263-
}
272+
},
273+
"required": [
274+
"name",
275+
"priority"
276+
]
264277
},
265278
"NamespaceType": {
266279
"type": "string",
@@ -283,7 +296,10 @@
283296
"path": {
284297
"$ref": "defs.json#/definitions/FilePath"
285298
}
286-
}
299+
},
300+
"required": [
301+
"type"
302+
]
287303
}
288304
}
289305
}

schema/defs.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,12 @@
163163
"size": {
164164
"$ref": "#/definitions/uint32"
165165
}
166-
}
166+
},
167+
"required": [
168+
"hostID",
169+
"containerID",
170+
"size"
171+
]
167172
},
168173
"Mount": {
169174
"type": "object",

specs-go/state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ type State struct {
1313
// BundlePath is the path to the container's bundle directory.
1414
BundlePath string `json:"bundlePath"`
1515
// Annotations are the annotations associated with the container.
16-
Annotations map[string]string `json:"annotations"`
16+
Annotations map[string]string `json:"annotations,omitempty"`
1717
}

0 commit comments

Comments
 (0)