Skip to content

Commit d118a8f

Browse files
committed
schema: updates and fixes
Several fields needed the correct typing, and updates for recent changes. Signed-off-by: Vincent Batts <[email protected]>
1 parent 81b865d commit d118a8f

File tree

3 files changed

+66
-56
lines changed

3 files changed

+66
-56
lines changed

schema/defs-linux.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@
9393
"type": "string"
9494
},
9595
"FileType": {
96-
"type": "integer"
96+
"description": "Type of a block or special character device",
97+
"type": "string",
98+
"pattern": "^[cbup]$"
9799
},
98100
"Device": {
99101
"properties": {

schema/schema-linux.json

Lines changed: 39 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@
6161
"id": "https://opencontainers.org/schema/bundle/linux/resources",
6262
"type": "object",
6363
"properties": {
64+
"oomScoreAdj": {
65+
"id": "https://opencontainers.org/schema/bundle/linux/resources/oomScoreAdj",
66+
"type": "integer",
67+
"minimum": -1000,
68+
"maximum": 1000
69+
},
70+
"pids": {
71+
"id": "https://opencontainers.org/schema/bundle/linux/resources/pids",
72+
"properties": {
73+
"limit": {
74+
"id": "https://opencontainers.org/schema/bundle/linux/resources/pids/limit",
75+
"$ref": "defs.json#/definitions/int64"
76+
}
77+
}
78+
},
6479
"blockIO": {
6580
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO",
6681
"type": "object",
@@ -94,11 +109,9 @@
94109
"oneOf": [
95110
{
96111
"type": "array",
97-
"items": [
98-
{
99-
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottlePointer"
100-
}
101-
]
112+
"items": {
113+
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottlePointer"
114+
}
102115
},
103116
{
104117
"type": "null"
@@ -110,11 +123,9 @@
110123
"oneOf": [
111124
{
112125
"type": "array",
113-
"items": [
114-
{
115-
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottlePointer"
116-
}
117-
]
126+
"items": {
127+
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottlePointer"
128+
}
118129
},
119130
{
120131
"type": "null"
@@ -126,11 +137,9 @@
126137
"oneOf": [
127138
{
128139
"type": "array",
129-
"items": [
130-
{
131-
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottlePointer"
132-
}
133-
]
140+
"items": {
141+
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottlePointer"
142+
}
134143
},
135144
{
136145
"type": "null"
@@ -140,11 +149,9 @@
140149
"blkioWeightDevice": {
141150
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioWeightDevice",
142151
"type": "array",
143-
"items": [
144-
{
145-
"$ref": "defs-linux.json#/definitions/blockIODeviceWeightPointer"
146-
}
147-
]
152+
"items": {
153+
"$ref": "defs-linux.json#/definitions/blockIODeviceWeightPointer"
154+
}
148155
}
149156
}
150157
},
@@ -190,13 +197,16 @@
190197
"id": "https://opencontainers.org/schema/bundle/linux/resources/hugepageLimits",
191198
"oneOf": [
192199
{
193-
"type": "object",
194-
"properties": {
195-
"pageSize": {
196-
"type": "string"
197-
},
198-
"limit": {
199-
"$ref": "defs.json#/definitions/uint64"
200+
"type": "array",
201+
"items": {
202+
"type": "object",
203+
"properties": {
204+
"pageSize": {
205+
"type": "string"
206+
},
207+
"limit": {
208+
"$ref": "defs.json#/definitions/uint64"
209+
}
200210
}
201211
}
202212
},
@@ -235,9 +245,9 @@
235245
"id": "https://opencontainers.org/schema/bundle/linux/resources/network",
236246
"type": "object",
237247
"properties": {
238-
"classId": {
248+
"classID": {
239249
"id": "https://opencontainers.org/schema/bundle/linux/resources/network/classId",
240-
"type": "string"
250+
"$ref": "defs.json#/definitions/uint32"
241251
},
242252
"priorities": {
243253
"id": "https://opencontainers.org/schema/bundle/linux/resources/network/priorities",
@@ -257,31 +267,6 @@
257267
}
258268
}
259269
},
260-
"rlimits": {
261-
"id": "https://opencontainers.org/schema/bundle/linux/rlimits",
262-
"items": [
263-
{
264-
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0",
265-
"properties": {
266-
"hard": {
267-
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0/hard",
268-
"type": "integer"
269-
},
270-
"soft": {
271-
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0/soft",
272-
"type": "integer"
273-
},
274-
"type": {
275-
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0/type",
276-
"type": "string",
277-
"pattern": "^RLIMIT_[A-Z]+$"
278-
}
279-
},
280-
"type": "object"
281-
}
282-
],
283-
"type": "array"
284-
},
285270
"cgroupsPath": {
286271
"oneOf": [
287272
{

schema/schema.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626
},
2727
"annotations": {
28-
"id": "https://opencontainers.org/schema/bundle/linux/sysctl",
28+
"id": "https://opencontainers.org/schema/bundle/annotations",
2929
"oneOf": [
3030
{
3131
"$ref": "defs.json#/definitions/mapStringString"
@@ -139,6 +139,29 @@
139139
"noNewPrivileges": {
140140
"id": "https://opencontainers.org/schema/bundle/process/linux/noNewPrivileges",
141141
"type": "boolean"
142+
},
143+
"rlimits": {
144+
"id": "https://opencontainers.org/schema/bundle/linux/rlimits",
145+
"type": "array",
146+
"items": {
147+
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0",
148+
"type": "object",
149+
"properties": {
150+
"hard": {
151+
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0/hard",
152+
"$ref": "defs.json#/definitions/uint64"
153+
},
154+
"soft": {
155+
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0/soft",
156+
"$ref": "defs.json#/definitions/uint64"
157+
},
158+
"type": {
159+
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0/type",
160+
"type": "string",
161+
"pattern": "^RLIMIT_[A-Z]+$"
162+
}
163+
}
164+
}
142165
}
143166
}
144167
},

0 commit comments

Comments
 (0)