Skip to content

Commit b0228e5

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

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

schema/config-schema.json

Lines changed: 26 additions & 3 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"
@@ -97,6 +118,10 @@
97118
"user": {
98119
"id": "https://opencontainers.org/schema/bundle/process/user",
99120
"type": "object",
121+
"required": [
122+
"uid",
123+
"gid"
124+
],
100125
"properties": {
101126
"uid": {
102127
"id": "https://opencontainers.org/schema/bundle/process/user/uid",
@@ -170,8 +195,6 @@
170195
"ociVersion",
171196
"platform",
172197
"process",
173-
"root",
174-
"mounts",
175-
"hooks"
198+
"root"
176199
]
177200
}

specs-go/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Spec struct {
1717
// Mounts configures additional mounts (on top of Root).
1818
Mounts []Mount `json:"mounts,omitempty"`
1919
// Hooks configures callbacks for container lifecycle events.
20-
Hooks Hooks `json:"hooks"`
20+
Hooks Hooks `json:"hooks,omitempty"`
2121
// Annotations contains arbitrary metadata for the container.
2222
Annotations map[string]string `json:"annotations,omitempty"`
2323

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)