Skip to content

Commit

Permalink
Remove platform field
Browse files Browse the repository at this point in the history
Close: opencontainers#725

See discussion in opencontainers#830 and dev-weekly-meeting discussion
in http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2017/opencontainers.2017-06-14-21.03.log.txt

We don't use this field in runc, and mostly only
image-spec cares about this, we can assume tools know
what specific platform this spec is built for.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
  • Loading branch information
hqhq committed Jun 16, 2017
1 parent b5017e2 commit af0e225
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 78 deletions.
39 changes: 3 additions & 36 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,47 +321,19 @@ For Windows based systems the user structure has the following fields:
"hostname": "mrsdalloway"
```

## <a name="configPlatform" />Platform

**`platform`** (object, REQUIRED) specifies the configuration's target platform.

* **`os`** (string, REQUIRED) specifies the operating system family of the container configuration's specified [`root`](#root) filesystem bundle.
The runtime MUST generate an error if it does not support the specified **`os`**.
Values SHOULD be, and runtimes SHOULD understand, **`os`** entries listed in the Go Language document for [`GOOS`][go-environment].
If an operating system is not included in the `GOOS` documentation, it SHOULD be submitted to this specification for standardization.
* **`arch`** (string, REQUIRED) specifies the instruction set for which the binaries in the specified [`root`](#root) filesystem bundle have been compiled.
The runtime MUST generate an error if it does not support the specified **`arch`**.
Values SHOULD be, 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.

### Example

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

## <a name="configPlatformSpecificConfiguration" />Platform-specific configuration

[**`platform.os`**](#platform) is used to specify platform-specific configuration.

* **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md).
This MAY be set if **`platform.os`** is `linux` and MUST NOT be set otherwise.
This MAY be set if the target platform of this spec is `linux`.
* **`windows`** (object, OPTIONAL) [Windows-specific configuration](config-windows.md).
This MUST be set if **`platform.os`** is `windows` and MUST NOT be set otherwise.
This MUST be set if the target platform of this spec is `windows`.
* **`solaris`** (object, OPTIONAL) [Solaris-specific configuration](config-solaris.md).
This MAY be set if **`platform.os`** is `solaris` and MUST NOT be set otherwise.
This MAY be set if the target platform of this spec is `solaris`.

### Example (Linux)

```json
{
"platform": {
"os": "linux",
"arch": "amd64"
},
"linux": {
"namespaces": [
{
Expand Down Expand Up @@ -477,10 +449,6 @@ Here is a full example `config.json` for reference.
```json
{
"ociVersion": "0.5.0-dev",
"platform": {
"os": "linux",
"arch": "amd64"
},
"process": {
"terminal": true,
"user": {
Expand Down Expand Up @@ -856,7 +824,6 @@ Here is a full example `config.json` for reference.
[no-new-privs]: https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt
[procfs_2]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt
[semver-v2.0.0]: http://semver.org/spec/v2.0.0.html
[go-environment]: https://golang.org/doc/install/source#environment
[ieee-1003.1-2008-xbd-c8.1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_01
[ieee-1003.1-2008-xsh-exec]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
[naming-a-volume]: https://aka.ms/nb3hqb
Expand Down
19 changes: 0 additions & 19 deletions schema/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,6 @@
"$ref": "defs.json#/definitions/Mount"
}
},
"platform": {
"id": "https://opencontainers.org/schema/bundle/platform",
"type": "object",
"required": [
"arch",
"os"
],
"properties": {
"arch": {
"id": "https://opencontainers.org/schema/bundle/platform/arch",
"type": "string"
},
"os": {
"id": "https://opencontainers.org/schema/bundle/platform/os",
"type": "string"
}
}
},
"root": {
"description": "Configures the container's root filesystem.",
"id": "https://opencontainers.org/schema/bundle/root",
Expand Down Expand Up @@ -233,7 +215,6 @@
},
"required": [
"ociVersion",
"platform",
"root"
]
}
4 changes: 0 additions & 4 deletions schema/test/config/good/minimal-for-start.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"ociVersion": "1.0.0",
"platform": {
"os": "linux",
"arch": "amd64"
},
"root": {
"path": "rootfs"
},
Expand Down
4 changes: 0 additions & 4 deletions schema/test/config/good/minimal.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"ociVersion": "1.0.0",
"platform": {
"os": "linux",
"arch": "amd64"
},
"root": {
"path": "rootfs"
}
Expand Down
4 changes: 0 additions & 4 deletions schema/test/config/good/spec-example.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"ociVersion": "0.5.0-dev",
"platform": {
"os": "linux",
"arch": "amd64"
},
"process": {
"terminal": true,
"user": {
Expand Down
11 changes: 0 additions & 11 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import "os"
type Spec struct {
// Version of the Open Container Runtime Specification with which the bundle complies.
Version string `json:"ociVersion"`
// Platform specifies the configuration's target platform.
Platform Platform `json:"platform"`
// Process configures the container process.
Process *Process `json:"process,omitempty"`
// Root configures the container's root filesystem.
Expand Down Expand Up @@ -101,15 +99,6 @@ type Root struct {
Readonly bool `json:"readonly,omitempty"`
}

// Platform specifies OS and arch information for the host system that the container
// is created for.
type Platform struct {
// OS is the operating system.
OS string `json:"os"`
// Arch is the architecture
Arch string `json:"arch"`
}

// Mount specifies a mount for a container.
type Mount struct {
// Destination is the absolute path where the mount will be placed in the container.
Expand Down

0 comments on commit af0e225

Please sign in to comment.