Skip to content

Commit

Permalink
image-index: remove platform.features field
Browse files Browse the repository at this point in the history
While the intended use of the `platform.features` field was to express
the availability of hardware instructions on CPUs, the practicality of
expressing and implementing such a standard has been called into
question. Much of the functionality is usually hidden deep within kernel
code or is defined by hardware vendors in ways that will make the field
unusable without future additions. Applications that can make use of such
field will likely have other requirements on top of this field that are
specific to a deployment.

In that regard, it is best to remove this field and defer to hardware to
make the decision about what can be run.

Signed-off-by: Stephen J Day <[email protected]>
  • Loading branch information
stevvooe committed May 11, 2017
1 parent 13eeafe commit 7ee20fd
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 60 deletions.
9 changes: 1 addition & 8 deletions image-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ For the media type(s) that this document is compatible with, see the [matrix][ma

This OPTIONAL property specifies the variant of the CPU, for example `armv6l` to specify a particular CPU variant of the ARM CPU.

- **`features`** *array of strings*

This OPTIONAL property specifies an array of strings, each specifying a mandatory CPU feature (for example `sse4` or `aes`).

- **`annotations`** *string-string map*

This OPTIONAL property contains arbitrary metadata for the image index.
Expand Down Expand Up @@ -98,10 +94,7 @@ For the media type(s) that this document is compatible with, see the [matrix][ma
"digest": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270",
"platform": {
"architecture": "amd64",
"os": "linux",
"os.features": [
"sse4"
]
"os": "linux"
}
}
],
Expand Down
7 changes: 2 additions & 5 deletions schema/backwards_compatibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestBackwardsCompatibilityImageIndex(t *testing.T) {
fail bool
}{
{
digest: "sha256:219f4b61132fe9d09b0ec5c15517be2ca712e4744b0e0cc3be71295b35b2a467",
digest: "sha256:b1182d6a4a707bb99c9f57d577e1ca1a77d1b792d8d7a5622b2ec0b60b7676c9",
imageIndex: `{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
Expand All @@ -69,10 +69,7 @@ func TestBackwardsCompatibilityImageIndex(t *testing.T) {
"digest": "sha256:ae1b0e06e8ade3a11267564a26e750585ba2259c0ecab59ab165ad1af41d1bdd",
"platform": {
"architecture": "amd64",
"os": "linux",
"features": [
"sse"
]
"os": "linux"
}
},
{
Expand Down
32 changes: 16 additions & 16 deletions schema/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ b1D07fCyW0vviMlWxN4UcYpZ/Enjdtf+RQ3SGiZ/vj8oANpKu/UTMV9kR1SDMjPzGZ6y5MQwnZvwWfX7
"/content-descriptor.json": {
local: "content-descriptor.json",
size: 1085,
modtime: 1493147571,
modtime: 1494380450,
compressed: `
H4sIAAAAAAAA/5yTwW7UMBCG73mKUVqpl27NoeIQVb3AnQPcEAevPY6nbGwznlW1oL47mniXJoAo3Vsy
+r+Zz8n4RwfQe6yOqQjl1A/QfyiY3uUklhIy6BMmgffHUGb4WNBRIGdn4lpbXFYXcbKKR5EyGPNQc9q0
Expand All @@ -238,7 +238,7 @@ ERcrb5b9zhBc4s2zO7r2jN/2xKhin3+/McttXS9NB/Cle+p+BgAA///HjexwPQQAAA==
"/defs-descriptor.json": {
local: "defs-descriptor.json",
size: 922,
modtime: 1493750367,
modtime: 1494380450,
compressed: `
H4sIAAAAAAAA/6STX2/TMBTF3/spLl7FgDZN4QFp0Ria2DsP42lTV93ZN/Ed8R/ZrqYy9bsjJ1naFYFA
PCSyj67Pub8b52kCIBRFGdgndlZUIK6oZst5F8FjSCw3LQZIDr56sl+cTciWAlwNx1yAa0+Sa5bYecx7
Expand Down Expand Up @@ -268,21 +268,21 @@ fIvD7in0ryMEy+fK1G6UfmdTE+tvpoL+1wV/AgAA//96IpqyhgYAAA==

"/image-index-schema.json": {
local: "image-index-schema.json",
size: 3151,
modtime: 1493147606,
size: 3009,
modtime: 1494544196,
compressed: `
H4sIAAAAAAAA/7yWP2/bPBDGd3+KgxIgSxK+eBF0MIIs7ZKpQ4MuRQaGPFmXWqR6pJO4hb97QTKyJ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fky+fky8dEt2rQp5qnZ5Quxho2DbIj
tNkcvCWALOZ/R7bRVgynbh8qslAQLhTYaA8tuAohVIZQGaIYvEQ1EBaEBtIOS+SAEJQneMq3MddSncuk
Rk2a6mWdzeHjJibeulgItXEkq4WmAq2zffudsmAWqx67w7o/72g7XbEv7+01G+jxr/Y+wvhrSYy+1o91
1MOjIvHg0y77YUu/BxFFJVqXrUOPPfGRhZHIbw+kC8SvhTDbewBThMXBWCCjlqggsRREzhkLn62wsFdq
3ZNrvzvOcoUFafIVbL4h6Sm0qelDOP1EIA1PK4d2EusIIGn36WY33Hv/D8GTvGqcKVk0FUmQFcqfdllD
VOhwI+Olt+H/NsI5ZA0Xt2JRGiZX1XfzW78WFaq7i+l9H66boa8lL4arJnUlYEER3U+Hgk0NrxXJCpw/
V6IXqMUKnhCUedULIxSq6dSBaidzsxCuMFyn3Mdt5rXOgHPnNoY9WzmMCZYVOZRuyTjIA8jMlqetPQx7
93GqnY5Pdp/vhe61wzomXWaDCe2YzVPiGXsaqOuX5JY8Bdxa9jSQBQr/HU7dwo3uHszty7JfNrk2DzYJ
0P7T9otgEjo9XA/p4d7/7c4jRGhtXHjgjZx+x3V5c5DlfdXJZ19fZDbmpfvVbj2Dxh1Neq2N2fgfAx40
YKZnZzb2Muw96WYAj7N29jcAAP//8RsPuMELAAA=
`,
},

Expand Down
7 changes: 1 addition & 6 deletions schema/image-index-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,7 @@
},
"variant": {
"type": "string"
},
"features": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
Expand Down
27 changes: 6 additions & 21 deletions schema/imageindex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ func TestImageIndex(t *testing.T) {
"digest": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270",
"platform": {
"architecture": "amd64",
"os": "linux",
"features": [
"sse4"
]
}
"os": "linux"
}
}
]
}
Expand All @@ -82,10 +79,7 @@ func TestImageIndex(t *testing.T) {
"size": 7682,
"platform": {
"architecture": "amd64",
"os": "linux",
"features": [
"sse4"
]
"os": "linux"
}
}
]
Expand Down Expand Up @@ -126,10 +120,7 @@ func TestImageIndex(t *testing.T) {
"digest": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270",
"platform": {
"architecture": "amd64",
"os": "linux",
"features": [
"sse4"
]
"os": "linux"
}
}
]
Expand All @@ -150,10 +141,7 @@ func TestImageIndex(t *testing.T) {
"digest": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270",
"platform": {
"architecture": "amd64",
"os": "linux",
"features": [
"sse4"
]
"os": "linux"
}
}
]
Expand Down Expand Up @@ -183,10 +171,7 @@ func TestImageIndex(t *testing.T) {
"digest": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270",
"platform": {
"architecture": "amd64",
"os": "linux",
"features": [
"sse4"
]
"os": "linux"
}
}
],
Expand Down
4 changes: 0 additions & 4 deletions specs-go/v1/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,4 @@ type Platform struct {
// Variant is an optional field specifying a variant of the CPU, for
// example `ppc64le` to specify a little-endian version of a PowerPC CPU.
Variant string `json:"variant,omitempty"`

// Features is an optional field specifying an array of strings, each
// listing a required CPU feature (for example `sse4` or `aes`).
Features []string `json:"features,omitempty"`
}

0 comments on commit 7ee20fd

Please sign in to comment.