Skip to content

Commit

Permalink
Expand platform to be more sophisticated
Browse files Browse the repository at this point in the history
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 <h.huangqiang@huawei.com>
  • Loading branch information
hqhq committed May 17, 2017
1 parent 4aed614 commit 68c84e7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
10 changes: 8 additions & 2 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,18 @@ For Windows based systems the user structure has the following fields:
The runtime MUST generate an error if it does not support the specified **`arch`**.
Values for **`arch`** SHOULD use, and runtimes SHOULD understand, **`arch`** entries listed in the Go Language document for [`GOARCH`][go-environment].
If an architecture is not included in the `GOARCH` documentation, it SHOULD be submitted to this specification for standardization.
* **`os.version`** (string, OPTIONAL) specifies the operating system version, for example `10.0.10586`.
* **`os.features`** (array of strings, OPTIONAL) specifies an array of strings, each specifying a mandatory OS feature, for example `win32k`.
* **`variant`** (string, OPTIONAL) specifies the variant of the CPU, for example `v8` to specify a perticular CPU variant of the ARM CPU.
* **`features`** (array of strings, OPTIONAL) this property is RESERVED for future versions of the specification.

### Example

```json
"platform": {
"os": "linux",
"arch": "amd64"
"arch": "amd64",
"variant": "v8"
}
```

Expand All @@ -338,7 +343,8 @@ Runtime implementations MAY support any valid values for platform-specific field
{
"platform": {
"os": "linux",
"arch": "amd64"
"arch": "amd64",
"variant": "v8"
},
"linux": {
"namespaces": [
Expand Down
17 changes: 16 additions & 1 deletion schema/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,22 @@
"os": {
"id": "https://opencontainers.org/schema/bundle/platform/os",
"type": "string"
}
},
"os.version": {
"id": "https://opencontainers.org/schema/bundle/platform/os.version",
"type": "string"
},
"os.features": {
"id": "https://opencontainers.org/schema/bundle/platform/os.features",
"type": "array",
"items": {
"type": "string"
}
},
"variant": {
"id": "https://opencontainers.org/schema/bundle/platform/variant",
"type": "string"
}
}
},
"root": {
Expand Down
8 changes: 8 additions & 0 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ type Platform struct {
OS string `json:"os"`
// Arch is the architecture
Arch string `json:"arch"`
// OSVersion specifies the operating system version, for example `10.0.10586`.
OSVersion string `json:"os.version,omitempry"`
// OSFeatures specifies an array of strings, each specifying a mandatory
// OS feature, for example `win32k`.
OSFeatures []string `json:"os.features,omitempry"`
// Variant specifies the variant of the CPU, for example `v8` to specify
// a perticular CPU variant of the ARM CPU.
Variant string `json:"variant,omitempry"`
}

// Mount specifies a mount for a container.
Expand Down

0 comments on commit 68c84e7

Please sign in to comment.