Skip to content

Commit e67faa6

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 e67faa6

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

image-index.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,41 @@ 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+
Image indexes SHOULD use, and implementations SHOULD understand the following convention:
60+
61+
operating system | convention |
62+
------------------|--------------------------------------------------------------------------------|
63+
`windows` | `sprintf("%d.%d.%d", dwMajorVersion, dwMinorVersion, dwBuildNumber)` with the fields of the `OSVERSIONINFOEX` structure returned by `GetVersionEx()`. e.g., `10.0.10586` |
64+
65+
If an operating system is not listed in this table, it SHOULD be submitted to this specification for standardization.
5966

6067
- **`os.features`** *array of strings*
6168

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

6472
- **`variant`** *string*
6573

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

6883
- **`features`** *array of strings*
6984

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

7294
- **`annotations`** *string-string map*
7395

@@ -100,7 +122,7 @@ For the media type(s) that this document is compatible with, see the [matrix][ma
100122
"architecture": "amd64",
101123
"os": "linux",
102124
"os.features": [
103-
"sse4"
125+
"sse4_2"
104126
]
105127
}
106128
}

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)