Skip to content

Commit 26d3b48

Browse files
committed
image-index: stipulate architecture-specific conventions
* os.version: speculated Windows-specific convention from the example * os.features: still unclear. should be clearly standardized in post-v1.0.0 * variant: speculated arm-specific convention from the example * features: speculated x86-specific convention from the example, and put little modification Signed-off-by: Akihiro Suda <[email protected]>
1 parent 8c4919e commit 26d3b48

File tree

3 files changed

+35
-12
lines changed

3 files changed

+35
-12
lines changed

image-index.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,42 @@ For the media type(s) that this document is compatible with, see the [matrix][ma
5555

5656
- **`os.version`** *string*
5757

58-
This OPTIONAL property specifies the operating system version, for example `10.0.10586`.
58+
This OPTIONAL property specifies the operating system version.
59+
60+
Image indexes SHOULD use, and implementations SHOULD understand the following convention:
61+
62+
operating system | convention |
63+
------------------|--------------------------------------------------------------------------------|
64+
`windows` | `sprintf("%d.%d.%d", dwMajorVersion, dwMinorVersion, dwBuildNumber)` with the fields of the `OSVERSIONINFOEX` structure returned by `GetVersionEx()`. e.g., `10.0.10586` |
65+
66+
If an operating system is not listed in this table, it SHOULD be submitted to this specification for standardization.
5967

6068
- **`os.features`** *array of strings*
6169

6270
This OPTIONAL property specifies an array of strings, each specifying a mandatory OS feature (for example on Windows `win32k`).
71+
A convention for other features SHOULD be submitted to this specification for standardization.
6372

6473
- **`variant`** *string*
6574

66-
This OPTIONAL property specifies the variant of the CPU, for example `armv6l` to specify a particular CPU variant of the ARM CPU.
75+
This OPTIONAL property specifies the variant of the CPU.
76+
Image indexes SHOULD use, and implementations SHOULD understand the following convention:
77+
78+
architecture | convention |
79+
--------------------|-------------------------------------------------------------------------------------------|
80+
`arm` and `arm64` | `machine` field of the Linux `utsname` structure returned by `uname(2)`. e.g., `armv6l`.|
81+
82+
If an architecture is not listed in this table, it SHOULD be submitted to this specification for standardization.
6783

6884
- **`features`** *array of strings*
6985

70-
This OPTIONAL property specifies an array of strings, each specifying a mandatory CPU feature (for example `sse4` or `aes`).
86+
This OPTIONAL property specifies an array of strings, each specifying a mandatory CPU feature.
87+
Image indexes SHOULD use, and implementations SHOULD understand the following convention:
88+
89+
architecture | convention |
90+
--------------------|--------------------------------------------------------------------------------|
91+
`386` and `amd64` | `flags` entries of the Linux `/proc/cpuinfo`. e.g., `sse4_2` or `aes`. |
92+
93+
If an architecture is not listed in this table, it SHOULD be submitted to this specification for standardization.
7194

7295
- **`annotations`** *string-string map*
7396

@@ -100,7 +123,7 @@ For the media type(s) that this document is compatible with, see the [matrix][ma
100123
"architecture": "amd64",
101124
"os": "linux",
102125
"os.features": [
103-
"sse4"
126+
"sse4_2"
104127
]
105128
}
106129
}

schema/imageindex_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func TestImageIndex(t *testing.T) {
6161
"architecture": "amd64",
6262
"os": "linux",
6363
"features": [
64-
"sse4"
64+
"sse4_2"
6565
]
6666
}
6767
}
@@ -84,7 +84,7 @@ func TestImageIndex(t *testing.T) {
8484
"architecture": "amd64",
8585
"os": "linux",
8686
"features": [
87-
"sse4"
87+
"sse4_2"
8888
]
8989
}
9090
}
@@ -128,7 +128,7 @@ func TestImageIndex(t *testing.T) {
128128
"architecture": "amd64",
129129
"os": "linux",
130130
"features": [
131-
"sse4"
131+
"sse4_2"
132132
]
133133
}
134134
}
@@ -152,7 +152,7 @@ func TestImageIndex(t *testing.T) {
152152
"architecture": "amd64",
153153
"os": "linux",
154154
"features": [
155-
"sse4"
155+
"sse4_2"
156156
]
157157
}
158158
}
@@ -185,7 +185,7 @@ func TestImageIndex(t *testing.T) {
185185
"architecture": "amd64",
186186
"os": "linux",
187187
"features": [
188-
"sse4"
188+
"sse4_2"
189189
]
190190
}
191191
}

specs-go/v1/index.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ type Platform struct {
2626
OS string `json:"os"`
2727

2828
// OSVersion is an optional field specifying the operating system
29-
// version, for example `10.0.10586`.
29+
// version, for example on Windows `10.0.10586`.
3030
OSVersion string `json:"os.version,omitempty"`
3131

3232
// OSFeatures is an optional field specifying an array of strings,
3333
// each listing a required OS feature (for example on Windows `win32k`).
3434
OSFeatures []string `json:"os.features,omitempty"`
3535

3636
// Variant is an optional field specifying a variant of the CPU, for
37-
// example `ppc64le` to specify a little-endian version of a PowerPC CPU.
37+
// example `armv6l` to specify a particular CPU variant of the ARM CPU.
3838
Variant string `json:"variant,omitempty"`
3939

4040
// Features is an optional field specifying an array of strings, each
41-
// listing a required CPU feature (for example `sse4` or `aes`).
41+
// listing a required CPU feature (for example `sse4_2` or `aes` on 386 and amd64).
4242
Features []string `json:"features,omitempty"`
4343
}
4444

0 commit comments

Comments
 (0)