Skip to content

Commit 68c84e7

Browse files
committed
Expand platform to be more sophisticated
Currently support is not sufficient for many platforms, such as ARM, we need more information to identify a specific platform. Image-spec already had these entries, so I just picked them up and applied to runtime-spec. Signed-off-by: Qiang Huang <[email protected]>
1 parent 4aed614 commit 68c84e7

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

config.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,18 @@ For Windows based systems the user structure has the following fields:
310310
The runtime MUST generate an error if it does not support the specified **`arch`**.
311311
Values for **`arch`** SHOULD use, and runtimes SHOULD understand, **`arch`** entries listed in the Go Language document for [`GOARCH`][go-environment].
312312
If an architecture is not included in the `GOARCH` documentation, it SHOULD be submitted to this specification for standardization.
313+
* **`os.version`** (string, OPTIONAL) specifies the operating system version, for example `10.0.10586`.
314+
* **`os.features`** (array of strings, OPTIONAL) specifies an array of strings, each specifying a mandatory OS feature, for example `win32k`.
315+
* **`variant`** (string, OPTIONAL) specifies the variant of the CPU, for example `v8` to specify a perticular CPU variant of the ARM CPU.
316+
* **`features`** (array of strings, OPTIONAL) this property is RESERVED for future versions of the specification.
313317

314318
### Example
315319

316320
```json
317321
"platform": {
318322
"os": "linux",
319-
"arch": "amd64"
323+
"arch": "amd64",
324+
"variant": "v8"
320325
}
321326
```
322327

@@ -338,7 +343,8 @@ Runtime implementations MAY support any valid values for platform-specific field
338343
{
339344
"platform": {
340345
"os": "linux",
341-
"arch": "amd64"
346+
"arch": "amd64",
347+
"variant": "v8"
342348
},
343349
"linux": {
344350
"namespaces": [

schema/config-schema.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,22 @@
5252
"os": {
5353
"id": "https://opencontainers.org/schema/bundle/platform/os",
5454
"type": "string"
55-
}
55+
},
56+
"os.version": {
57+
"id": "https://opencontainers.org/schema/bundle/platform/os.version",
58+
"type": "string"
59+
},
60+
"os.features": {
61+
"id": "https://opencontainers.org/schema/bundle/platform/os.features",
62+
"type": "array",
63+
"items": {
64+
"type": "string"
65+
}
66+
},
67+
"variant": {
68+
"id": "https://opencontainers.org/schema/bundle/platform/variant",
69+
"type": "string"
70+
}
5671
}
5772
},
5873
"root": {

specs-go/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ type Platform struct {
108108
OS string `json:"os"`
109109
// Arch is the architecture
110110
Arch string `json:"arch"`
111+
// OSVersion specifies the operating system version, for example `10.0.10586`.
112+
OSVersion string `json:"os.version,omitempry"`
113+
// OSFeatures specifies an array of strings, each specifying a mandatory
114+
// OS feature, for example `win32k`.
115+
OSFeatures []string `json:"os.features,omitempry"`
116+
// Variant specifies the variant of the CPU, for example `v8` to specify
117+
// a perticular CPU variant of the ARM CPU.
118+
Variant string `json:"variant,omitempry"`
111119
}
112120

113121
// Mount specifies a mount for a container.

0 commit comments

Comments
 (0)